Search Results for

    Show / Hide Table of Contents

    Class SkeletonCollection<T>

    Base class for collections used in a FileSkeleton.

    Inheritance
    Object
    KeyBasedCollection<SkeletonCollectionKey, T>
    SkeletonCollection<T>
    Implements
    IList<T>
    ICollection<T>
    IEnumerable<T>
    IEnumerable
    IEquatable<KeyBasedCollection<SkeletonCollectionKey, T>>
    Inherited Members
    KeyBasedCollection<SkeletonCollectionKey, T>.ThreadSafeListHandler
    KeyBasedCollection<SkeletonCollectionKey, T>.KeyMap
    KeyBasedCollection<SkeletonCollectionKey, T>.OnItemAdded(T)
    KeyBasedCollection<SkeletonCollectionKey, T>.ForEach(Action<T>)
    KeyBasedCollection<SkeletonCollectionKey, T>.Equals(KeyBasedCollection<SkeletonCollectionKey, T>)
    KeyBasedCollection<SkeletonCollectionKey, T>.Equals(Object)
    KeyBasedCollection<SkeletonCollectionKey, T>.GetHashCode()
    KeyBasedCollection<SkeletonCollectionKey, T>.TryGetValue(SkeletonCollectionKey)
    KeyBasedCollection<SkeletonCollectionKey, T>.Add(T)
    KeyBasedCollection<SkeletonCollectionKey, T>.Clear()
    KeyBasedCollection<SkeletonCollectionKey, T>.GetKeyFor(T)
    KeyBasedCollection<SkeletonCollectionKey, T>.Contains(T)
    KeyBasedCollection<SkeletonCollectionKey, T>.Contains(SkeletonCollectionKey)
    KeyBasedCollection<SkeletonCollectionKey, T>.ContainsKey(SkeletonCollectionKey)
    KeyBasedCollection<SkeletonCollectionKey, T>.CopyTo(T[], Int32)
    KeyBasedCollection<SkeletonCollectionKey, T>.IndexOf(T)
    KeyBasedCollection<SkeletonCollectionKey, T>.Insert(Int32, T)
    KeyBasedCollection<SkeletonCollectionKey, T>.Remove(T)
    KeyBasedCollection<SkeletonCollectionKey, T>.Remove(SkeletonCollectionKey)
    KeyBasedCollection<SkeletonCollectionKey, T>.RemoveAt(Int32)
    KeyBasedCollection<SkeletonCollectionKey, T>.GetEnumerator()
    KeyBasedCollection<SkeletonCollectionKey, T>.IEnumerable.GetEnumerator()
    KeyBasedCollection<SkeletonCollectionKey, T>.Item[SkeletonCollectionKey]
    KeyBasedCollection<SkeletonCollectionKey, T>.Item[Int32]
    KeyBasedCollection<SkeletonCollectionKey, T>.Count
    KeyBasedCollection<SkeletonCollectionKey, T>.IsReadOnly
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Sdl.LanguagePlatform.TranslationMemoryApi.LiteBCM.Skeleton
    Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
    Syntax
    public class SkeletonCollection<T> : KeyBasedCollection<SkeletonCollectionKey, T>, IList<T>, ICollection<T>, IEnumerable<T>, IEnumerable, IEquatable<KeyBasedCollection<SkeletonCollectionKey, T>> where T : SkeletonItem
    Type Parameters
    Name Description
    T

    Constructors

    SkeletonCollection()

    Instantiates a new instance of the SkeletonCollection<T> class.

    Declaration
    public SkeletonCollection()

    SkeletonCollection(IList<T>)

    Instantiates a new instance of the SkeletonCollection<T> class starting with a given enumeration of items.

    Declaration
    public SkeletonCollection(IList<T> items)
    Parameters
    Type Name Description
    IList<T> items

    The items to be used to seed the collection.

    Properties

    IdGenerator

    Gets the IdGenerator.

    Declaration
    public IdGenerator IdGenerator { get; }
    Property Value
    Type Description
    IdGenerator

    The IdGenerator.

    ParentSkeleton

    Gets or sets the parent FileSkeleton.

    Declaration
    public FileSkeleton ParentSkeleton { get; }
    Property Value
    Type Description
    FileSkeleton

    The parent FileSkeleton.

    Methods

    GetById(Int32)

    Gets an element by its numerical id.

    Declaration
    public T GetById(int id)
    Parameters
    Type Name Description
    Int32 id

    The id.

    Returns
    Type Description
    T

    If found, returns the element with the Id id; otherwise returns default(T)

    GetOrAdd(T)

    Gets the element if it already exists in the collection. Otherwise, it is added to the collection and gives it the next ID in the IdGenerator sequence.

    Declaration
    public T GetOrAdd(T elem)
    Parameters
    Type Name Description
    T elem

    The element.

    Returns
    Type Description
    T

    The existing element; or the newly added one with an Id set.

    GetOrAddWithExistingId(T)

    Gets the element if it already exists in the collection. Otherwise, it is added to the collection (preserving its existing ID).

    Declaration
    public T GetOrAddWithExistingId(T elem)
    Parameters
    Type Name Description
    T elem

    The element.

    Returns
    Type Description
    T

    The existing element; or the newly added one with an Id set.

    OnItemAdded(T)

    Ensures the item has an Id set according to the IdGenerator owned by the skeleton. This is only performed if the item has id 0, otherwise it is left untouched.

    Declaration
    protected override void OnItemAdded(T item)
    Parameters
    Type Name Description
    T item

    The item to have id calculated if needed.

    Overrides
    Sdl.LanguagePlatform.TranslationMemoryApi.LiteBCM.Collection.KeyBasedCollection<Sdl.LanguagePlatform.TranslationMemoryApi.LiteBCM.Skeleton.SkeletonCollectionKey, T>.OnItemAdded(T)

    Implements

    System.Collections.Generic.IList<T>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable
    System.IEquatable<T>
    In this article
    Back to top Generated by DocFX