Search Results for

    Show / Hide Table of Contents

    Class SkeletonCollection<T>

    Base class for collections used in a FileSkeleton.

    Inheritance
    object
    Collection<T>
    KeyedCollection<SkeletonCollectionKey, T>
    SkeletonCollection<T>
    Implements
    IList<T>
    ICollection<T>
    IList
    ICollection
    IReadOnlyList<T>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable
    IEquatable<SkeletonCollection<T>>
    Inherited Members
    KeyedCollection<SkeletonCollectionKey, T>.Contains(SkeletonCollectionKey)
    KeyedCollection<SkeletonCollectionKey, T>.TryGetValue(SkeletonCollectionKey, out T)
    KeyedCollection<SkeletonCollectionKey, T>.Remove(SkeletonCollectionKey)
    KeyedCollection<SkeletonCollectionKey, T>.ChangeItemKey(T, SkeletonCollectionKey)
    KeyedCollection<SkeletonCollectionKey, T>.ClearItems()
    KeyedCollection<SkeletonCollectionKey, T>.GetKeyForItem(T)
    KeyedCollection<SkeletonCollectionKey, T>.InsertItem(int, T)
    KeyedCollection<SkeletonCollectionKey, T>.RemoveItem(int)
    KeyedCollection<SkeletonCollectionKey, T>.SetItem(int, T)
    KeyedCollection<SkeletonCollectionKey, T>.Comparer
    KeyedCollection<SkeletonCollectionKey, T>.this[SkeletonCollectionKey]
    KeyedCollection<SkeletonCollectionKey, T>.Dictionary
    Collection<T>.Add(T)
    Collection<T>.Clear()
    Collection<T>.CopyTo(T[], int)
    Collection<T>.Contains(T)
    Collection<T>.GetEnumerator()
    Collection<T>.IndexOf(T)
    Collection<T>.Insert(int, T)
    Collection<T>.Remove(T)
    Collection<T>.RemoveAt(int)
    Collection<T>.Count
    Collection<T>.Items
    Collection<T>.this[int]
    object.GetType()
    object.MemberwiseClone()
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    Namespace: Sdl.Core.Bcm.BcmModel.Skeleton
    Assembly: Sdl.Core.Bcm.BcmModel.dll
    Syntax
    public class SkeletonCollection<T> : KeyedCollection<SkeletonCollectionKey, T>, IList<T>, ICollection<T>, IList, ICollection, IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable, IEquatable<SkeletonCollection<T>> where T : SkeletonItem
    Type Parameters
    Name Description
    T

    Constructors

    SkeletonCollection()

    Declaration
    public SkeletonCollection()

    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; set; }
    Property Value
    Type Description
    FileSkeleton

    The parent FileSkeleton.

    Methods

    ClearItems()

    Removes all elements from the KeyedCollection<TKey, TItem>.

    Declaration
    protected override void ClearItems()
    Overrides
    KeyedCollection<SkeletonCollectionKey, T>.ClearItems()

    Equals(SkeletonCollection<T>)

    Performs a deep-equals comparison.
    System.Object.Equals(object)

    Declaration
    public bool Equals(SkeletonCollection<T> other)
    Parameters
    Type Name Description
    SkeletonCollection<T> other
    Returns
    Type Description
    bool

    GetById(int)

    Gets an element by its numerical id.

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

    The id.

    Returns
    Type Description
    T

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

    GetKeyForItem(T)

    Extracts the key from the specified element.

    Declaration
    protected override SkeletonCollectionKey GetKeyForItem(T item)
    Parameters
    Type Name Description
    T item

    The element from which to extract the key.

    Returns
    Type Description
    SkeletonCollectionKey

    The key for the specified element.

    Overrides
    KeyedCollection<SkeletonCollectionKey, T>.GetKeyForItem(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.

    InsertItem(int, T)

    Inserts an element into the KeyedCollection<TKey, TItem> at the specified index.

    Declaration
    protected override void InsertItem(int index, T item)
    Parameters
    Type Name Description
    int index

    The zero-based index at which item should be inserted.

    T item

    The object to insert.

    Overrides
    KeyedCollection<SkeletonCollectionKey, T>.InsertItem(int, T)

    RemoveItem(int)

    Removes the element at the specified index of the KeyedCollection<TKey, TItem>.

    Declaration
    protected override void RemoveItem(int index)
    Parameters
    Type Name Description
    int index

    The index of the element to remove.

    Overrides
    KeyedCollection<SkeletonCollectionKey, T>.RemoveItem(int)

    SetItem(int, T)

    Replaces the item at the specified index with the specified item.

    Declaration
    protected override void SetItem(int index, T item)
    Parameters
    Type Name Description
    int index

    The zero-based index of the item to be replaced.

    T item

    The new item.

    Overrides
    KeyedCollection<SkeletonCollectionKey, T>.SetItem(int, T)

    Implements

    IList<T>
    ICollection<T>
    IList
    ICollection
    IReadOnlyList<T>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable
    IEquatable<T>

    Extension Methods

    ModelExtensions.IsSequenceEqual<TSource>(IList<TSource>, IList<TSource>)
    In this article
    Back to top Generated by DocFX