Class PicklistItems
Encapsulates a collection of picklist items.
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemory
Assembly: Sdl.LanguagePlatform.TranslationMemory.dll
Syntax
[DataContract]
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, bool)
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. |
bool | 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 |
---|---|---|
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 |
---|---|
bool |
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 |
---|---|---|
string | name |
Returns
Type | Description |
---|---|
bool |
Equals(object)
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with the current object. |
Returns
Type | Description |
---|---|
bool | 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 |
---|---|
IEnumeratorPicklistItem | An enumerator |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int |
Overrides
GetNames()
Retrieves the names of the picklist values as a string list.
Declaration
public List<string> GetNames()
Returns
Type | Description |
---|---|
Liststring |
Lookup(int)
Retrieves an item with the specified ID.
Declaration
public PicklistItem Lookup(int id)
Parameters
Type | Name | Description |
---|---|---|
int | 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 |
---|---|---|
string | name | The item value. |
Returns
Type | Description |
---|---|
PicklistItem | The picklist item or null if no such item exists. |