Class PicklistItems
Encapsulates a collection of picklist items.
Inheritance
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
public class PicklistItems : IEnumerable<PicklistItem>, IEnumerable
Constructors
PicklistItems()
Initializes a new instance with an empty list of items.
Declaration
public PicklistItems()
PicklistItems(PicklistItems)
Initializes a new instance with the values of another instance, creating a deep copy.
Declaration
public PicklistItems(PicklistItems other)
Parameters
Type | Name | Description |
---|---|---|
PicklistItems | other | The other instance |
Methods
Add(PicklistItem)
Creates a new picklist item with the specified value and adds it to the list. Duplicate checks are done on the item's name and also on the item's ID, if provided.
Declaration
public void Add(PicklistItem pli)
Parameters
Type | Name | Description |
---|---|---|
PicklistItem | pli | The new item. |
Add(PicklistItem, Boolean)
Creates a new picklist item with the specified value and adds it to the list. Duplicate checks are done on the item's name and also on the item's ID, if provided.
Declaration
public void Add(PicklistItem pli, bool ignoreDups)
Parameters
Type | Name | Description |
---|---|---|
PicklistItem | pli | The new item. |
System.Boolean | ignoreDups |
Add(String)
Creates a new picklist item with the specified value and adds it to the list.
Declaration
public PicklistItem Add(string itemName)
Parameters
Type | Name | Description |
---|---|---|
System.String | itemName | The new item value. |
Returns
Type | Description |
---|---|
PicklistItem | The newly created picklist item or an error if the item already exists. |
Clear()
Clears the list of picklist values.
Declaration
public void Clear()
Contains(PicklistItem)
Returns true if the specified picklist value exists in the collection, and false otherwise.
Declaration
public bool Contains(PicklistItem item)
Parameters
Type | Name | Description |
---|---|---|
PicklistItem | item |
Returns
Type | Description |
---|---|
System.Boolean |
Contains(String)
Returns true if the specified picklist value exists in the collection, and false otherwise.
Declaration
public bool Contains(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Returns
Type | Description |
---|---|
System.Boolean |
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
System.Boolean | true if the specified object is equal to the current object; otherwise, false. |
Overrides
GetEnumerator()
Returns an enumerator which can be used to iterate through the picklist items.
Declaration
public IEnumerator<PicklistItem> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerator<PicklistItem> | An enumerator |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 |
Overrides
GetNames()
Retrieves the names of the picklist values as a string list.
Declaration
public List<string> GetNames()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.String> |
Lookup(Int32)
Retrieves an item with the specified ID.
Declaration
public PicklistItem Lookup(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The ID. |
Returns
Type | Description |
---|---|
PicklistItem | The picklist item or null if no such item exists. |
Lookup(String)
Retrieves an item with the specified value.
Declaration
public PicklistItem Lookup(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The item value. |
Returns
Type | Description |
---|---|
PicklistItem | The picklist item or null if no such item exists. |
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator which can be used to iterate through the picklist items.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.IEnumerator | An enumerator |