Search Results for

    Show / Hide Table of Contents

    Class KeyBasedCollection<TKey, TValue>

    A KeyBasedCollection<TKey, TValue> implementation with support for deep equality.

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

    The key.

    TValue

    The value.

    Constructors

    KeyBasedCollection()

    Initializes a new instance of the KeyBasedCollection<TKey, TValue> class.

    Declaration
    protected KeyBasedCollection()

    KeyBasedCollection(Func<TValue, TKey>)

    Initializes a new instance of the KeyBasedCollection<TKey, TValue> class.

    Declaration
    public KeyBasedCollection(Func<TValue, TKey> keySelector)
    Parameters
    Type Name Description
    Func<TValue, TKey> keySelector

    The key selector.

    Fields

    KeySelector

    The key selector.

    Declaration
    protected Func<TValue, TKey> KeySelector
    Field Value
    Type Description
    Func<TValue, TKey>

    Methods

    Equals(KeyBasedCollection<TKey, TValue>)

    Indicates whether the current object is equal to another object of the same type.

    Declaration
    public bool Equals(KeyBasedCollection<TKey, TValue> other)
    Parameters
    Type Name Description
    KeyBasedCollection<TKey, TValue> other

    An object to compare with this object.

    Returns
    Type Description
    bool

    true if the current object is equal to the other parameter; otherwise, false.

    Equals(object)

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

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj
    Returns
    Type Description
    bool
    Overrides
    object.Equals(object)

    ForEach(Action<TValue>)

    Executes an action over each element of the collection.

    Declaration
    public void ForEach(Action<TValue> action)
    Parameters
    Type Name Description
    Action<TValue> action

    The action.

    GetHashCode()

    Returns a hash code for this instance.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    A hash code for this instance.

    Overrides
    object.GetHashCode()

    GetKeyForItem(TValue)

    When implemented in a derived class, extracts the key from the specified element.

    Declaration
    protected override TKey GetKeyForItem(TValue item)
    Parameters
    Type Name Description
    TValue item

    The element from which to extract the key.

    Returns
    Type Description
    TKey

    The key for the specified element.

    Overrides
    KeyedCollection<TKey, TValue>.GetKeyForItem(TValue)

    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