Search Results for

    Show / Hide Table of Contents

    Class PicklistItems

    Encapsulates a collection of picklist items.

    Inheritance
    System.Object
    PicklistItems
    Implements
    System.Collections.Generic.IEnumerable<PicklistItem>
    System.Collections.IEnumerable
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    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)

    System.Object.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
    System.Object.Equals(System.Object)

    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()

    System.Object.GetHashCode(object)
    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()

    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

    Implements

    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    On this page

    • Constructors
      • PicklistItems()
      • PicklistItems(PicklistItems)
    • Methods
      • Add(PicklistItem)
      • Add(PicklistItem, Boolean)
      • Add(String)
      • Clear()
      • Contains(PicklistItem)
      • Contains(String)
      • Equals(Object)
      • GetEnumerator()
      • GetHashCode()
      • GetNames()
      • Lookup(Int32)
      • Lookup(String)
    • Explicit Interface Implementations
      • IEnumerable.GetEnumerator()
    • Implements
    Back to top Generated by DocFX