Stride

OPEN / CLOSE
  • Features
  • Blog
  • Documentation
  • Community
(icon) Download

  • Discord
  • Facebook
  • Twitter
  • YouTube

LANGUAGE

OPEN / CLOSE
  • English
  • 日本語
    Show / Hide Table of Contents

    TrackingDictionary<TKey, TValue> Class

    Namespace: Stride.Core.Collections
    Assembly: Stride.Core.dll

    Represents a dictionary of key/value pairs that generates events when items get added or removed.

    System.Object → TrackingDictionary<TKey, TValue>
    Derived from TrackingDictionary<TKey, TValue>:

    [DataSerializer(typeof(DictionaryAllSerializer<,, >), Mode = DataSerializerGenericMode.TypeAndGenericArguments)]
    public class TrackingDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable, ITrackingCollectionChanged
    Type Parameters
    Name Description
    TKey

    The type of the key.

    TValue

    The type of the value.

    Remarks

    Underlying storage is done with a System.Collections.Generic.Dictionary<TKey, TValue>.

    Name Description
    Constructors
    TrackingDictionary()

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

    Properties
    Count
    IsReadOnly
    Item[TKey]
    Keys
    Values
    Methods
    Add(TKey, TValue)
    Add(KeyValuePair<TKey, TValue>)
    Clear()
    Contains(KeyValuePair<TKey, TValue>)
    ContainsKey(TKey)
    CopyTo(KeyValuePair<TKey, TValue>[], Int32)
    GetEnumerator()
    Remove(TKey)
    Remove(KeyValuePair<TKey, TValue>)
    TryGetValue(TKey, out TValue)
    Events
    CollectionChanged

    Occurs when [collection changed].

    Explicit Interface Implementations
    ICollection.CopyTo(Array, Int32)
    ICollection.IsSynchronized
    ICollection.SyncRoot
    IDictionary.Add(Object, Object)
    IDictionary.Contains(Object)
    IDictionary.GetEnumerator()
    IDictionary.IsFixedSize
    IDictionary.Item[Object]
    IDictionary.Keys
    IDictionary.Remove(Object)
    IDictionary.Values
    IEnumerable.GetEnumerator()
    | Improve this Doc View Source

    Constructors


    TrackingDictionary()

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

    public TrackingDictionary()
    | Improve this Doc View Source

    Properties


    Count

    public int Count { get; }
    Property Value
    Type Description
    System.Int32

    IsReadOnly

    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean

    Item[TKey]

    public TValue this[TKey key] { get; set; }
    Parameters
    Type Name Description
    TKey key
    Property Value
    Type Description
    TValue

    Keys

    public ICollection<TKey> Keys { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<TKey>

    Values

    public ICollection<TValue> Values { get; }
    Property Value
    Type Description
    System.Collections.Generic.ICollection<TValue>
    | Improve this Doc View Source

    Methods


    Add(TKey, TValue)

    public void Add(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value

    Add(KeyValuePair<TKey, TValue>)

    public void Add(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> item

    Clear()

    public void Clear()

    Contains(KeyValuePair<TKey, TValue>)

    public bool Contains(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> item
    Returns
    Type Description
    System.Boolean

    ContainsKey(TKey)

    public bool ContainsKey(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Boolean

    CopyTo(KeyValuePair<TKey, TValue>[], Int32)

    public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue>[] array
    System.Int32 arrayIndex

    GetEnumerator()

    public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>

    Remove(TKey)

    public bool Remove(TKey key)
    Parameters
    Type Name Description
    TKey key
    Returns
    Type Description
    System.Boolean

    Remove(KeyValuePair<TKey, TValue>)

    public bool Remove(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> item
    Returns
    Type Description
    System.Boolean

    TryGetValue(TKey, out TValue)

    public bool TryGetValue(TKey key, out TValue value)
    Parameters
    Type Name Description
    TKey key
    TValue value
    Returns
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Events


    CollectionChanged

    Occurs when [collection changed].

    public event EventHandler<TrackingCollectionChangedEventArgs> CollectionChanged
    Event Type
    Type Description
    System.EventHandler<TrackingCollectionChangedEventArgs>
    | Improve this Doc View Source

    Explicit Interface Implementations


    ICollection.CopyTo(Array, Int32)

    void ICollection.CopyTo(Array array, int index)
    Parameters
    Type Name Description
    System.Array array
    System.Int32 index

    ICollection.IsSynchronized

    bool ICollection.IsSynchronized { get; }
    Returns
    Type Description
    System.Boolean

    ICollection.SyncRoot

    object ICollection.SyncRoot { get; }
    Returns
    Type Description
    System.Object

    IDictionary.Add(Object, Object)

    void IDictionary.Add(object key, object value)
    Parameters
    Type Name Description
    System.Object key
    System.Object value

    IDictionary.Contains(Object)

    bool IDictionary.Contains(object key)
    Parameters
    Type Name Description
    System.Object key
    Returns
    Type Description
    System.Boolean

    IDictionary.GetEnumerator()

    IDictionaryEnumerator IDictionary.GetEnumerator()
    Returns
    Type Description
    System.Collections.IDictionaryEnumerator

    IDictionary.IsFixedSize

    bool IDictionary.IsFixedSize { get; }
    Returns
    Type Description
    System.Boolean

    IDictionary.Item[Object]

    object IDictionary.this[object key] { get; set; }
    Parameters
    Type Name Description
    System.Object key
    Returns
    Type Description
    System.Object

    IDictionary.Keys

    ICollection IDictionary.Keys { get; }
    Returns
    Type Description
    System.Collections.ICollection

    IDictionary.Remove(Object)

    void IDictionary.Remove(object key)
    Parameters
    Type Name Description
    System.Object key

    IDictionary.Values

    ICollection IDictionary.Values { get; }
    Returns
    Type Description
    System.Collections.ICollection

    IEnumerable.GetEnumerator()

    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Extension Methods

    ComponentBaseExtensions.DisposeBy<T>(T, ICollectorHolder)
    ComponentBaseExtensions.RemoveDisposeBy<T>(T, ICollectorHolder)
    ArrayExtensions.ComputeHash<T>(ICollection<T>, IEqualityComparer<T>)
    EnumerableExtensions.IsNullOrEmpty(IEnumerable)
    EnumerableExtensions.ForEach<T>(IEnumerable, Action<T>)
    EnumerableExtensions.ForEach<T>(IEnumerable<T>, Action<T>)
    EnumerableExtensions.IndexOf<T>(IEnumerable<T>, Func<T, Boolean>)
    EnumerableExtensions.LastIndexOf<T>(IEnumerable<T>, Func<T, Boolean>)
    • Improve this Doc
    • View Source
    In This Article

    Back to top

    Copyright © 2019-2021 .NET Foundation and Contributors
    Supported by the .NET Foundation