Show / Hide Table of Contents

    Class WeakKeyDictionary<TKey, TValue>

    Dictionary with weak reference for the key.

    Inheritance
    Object
    ConcurrentDictionary<WeakKey<TKey>, TValue>
    WeakKeyDictionary<TKey, TValue>
    Implements
    IDictionary<WeakKey<TKey>, TValue>
    ICollection<KeyValuePair<WeakKey<TKey>, TValue>>
    IDictionary
    ICollection
    IReadOnlyDictionary<WeakKey<TKey>, TValue>
    IReadOnlyCollection<KeyValuePair<WeakKey<TKey>, TValue>>
    IEnumerable<KeyValuePair<WeakKey<TKey>, TValue>>
    IEnumerable
    Inherited Members
    ConcurrentDictionary<WeakKey<TKey>, TValue>.TryAdd(WeakKey<TKey>, TValue)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.ContainsKey(WeakKey<TKey>)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.TryRemove(WeakKey<TKey>, TValue)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.TryGetValue(WeakKey<TKey>, TValue)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.TryUpdate(WeakKey<TKey>, TValue, TValue)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.Clear()
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>>.CopyTo(System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>[], System.Int32)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.ToArray()
    ConcurrentDictionary<WeakKey<TKey>, TValue>.GetEnumerator()
    ConcurrentDictionary<WeakKey<TKey>, TValue>.GetOrAdd(WeakKey<TKey>, Func<WeakKey<TKey>, TValue>)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.GetOrAdd(WeakKey<TKey>, TValue)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.GetOrAdd<TArg>(WeakKey<TKey>, Func<WeakKey<TKey>, TArg, TValue>, TArg)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.AddOrUpdate<TArg>(WeakKey<TKey>, Func<WeakKey<TKey>, TArg, TValue>, Func<WeakKey<TKey>, TValue, TArg, TValue>, TArg)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.AddOrUpdate(WeakKey<TKey>, Func<WeakKey<TKey>, TValue>, Func<WeakKey<TKey>, TValue, TValue>)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.AddOrUpdate(WeakKey<TKey>, TValue, Func<WeakKey<TKey>, TValue, TValue>)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.IDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.Add(Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.IDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.Remove(Microsoft.Graph.Communications.Common.WeakKey<TKey>)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>>.Add(System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>>.Contains(System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>>.Remove(System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IEnumerable.GetEnumerator()
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.Add(Object, Object)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.Contains(Object)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.GetEnumerator()
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.Remove(Object)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.IDictionary.get_Item(System.Object)
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.IDictionary.set_Item(System.Object, System.Object)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.ICollection.CopyTo(Array, Int32)
    ConcurrentDictionary<WeakKey<TKey>, TValue>.Item[WeakKey<TKey>]
    ConcurrentDictionary<WeakKey<TKey>, TValue>.Count
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IsEmpty
    ConcurrentDictionary<WeakKey<TKey>, TValue>.Keys
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.IReadOnlyDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.Keys
    ConcurrentDictionary<WeakKey<TKey>, TValue>.Values
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.IReadOnlyDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.Values
    System.Collections.Concurrent.ConcurrentDictionary<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<Microsoft.Graph.Communications.Common.WeakKey<TKey>, TValue>>.IsReadOnly
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.IsFixedSize
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.IsReadOnly
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.Keys
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.Values
    ConcurrentDictionary<WeakKey<TKey>, TValue>.IDictionary.Item[Object]
    ConcurrentDictionary<WeakKey<TKey>, TValue>.ICollection.IsSynchronized
    ConcurrentDictionary<WeakKey<TKey>, TValue>.ICollection.SyncRoot
    Object.ToString()
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Namespace: Microsoft.Graph.Communications.Common
    Assembly: Microsoft.Graph.Communications.Common.dll
    Syntax
    public class WeakKeyDictionary<TKey, TValue> : ConcurrentDictionary<WeakKey<TKey>, TValue>, IDictionary<WeakKey<TKey>, TValue>, ICollection<KeyValuePair<WeakKey<TKey>, TValue>>, IDictionary, ICollection, IReadOnlyDictionary<WeakKey<TKey>, TValue>, IReadOnlyCollection<KeyValuePair<WeakKey<TKey>, TValue>>, IEnumerable<KeyValuePair<WeakKey<TKey>, TValue>>, IEnumerable where TKey : class
    Type Parameters
    Name Description
    TKey

    Key type which must be a reference type.

    TValue

    Value type.

    Constructors

    WeakKeyDictionary()

    Declaration
    public WeakKeyDictionary()

    Methods

    Cleanup()

    Cleans keys where the weak references have been garbage collected.

    Declaration
    public void Cleanup()

    Implements

    System.Collections.Generic.IDictionary<TKey,TValue>
    System.Collections.Generic.ICollection<T>
    System.Collections.IDictionary
    System.Collections.ICollection
    System.Collections.Generic.IReadOnlyDictionary<TKey,TValue>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IEnumerable

    Extension Methods

    AdditionalDataExtensions.SetInAdditionalData(Object, String, Object)
    Extensions.Pin(Object)
    Extensions.ChangeType(Object, Type)
    Extensions.ChangeType<T>(Object)
    Extensions.TryDispose(Object, IGraphLogger)
    CollectionUtils.ForEach<T>(IEnumerable<T>, Action<T>)
    CollectionUtils.ForEachParallel<T>(IEnumerable<T>, Action<T>, IGraphLogger)
    CollectionUtils.GetValueOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey)
    CollectionUtils.GetValueOrDefault<TKey, TValue>(IDictionary<TKey, TValue>, TKey, TValue)
    CollectionUtils.AddRange<T>(ICollection<T>, IEnumerable<T>)
    CollectionUtils.ToSortedList<TKey, TValue>(IEnumerable<TValue>, Func<TValue, TKey>)
    ReflectionUtils.GetPropertyUsingReflection(Object, String)
    ReflectionUtils.SetPropertyUsingReflection(Object, String, Object)
    Validator.Any(IEnumerable)
    Validator.FirstObject(IEnumerable, Func<Object, Boolean>)
    Validator.FirstObject(IEnumerable)
    Validator.IsNull(Object, String, String)
    Validator.NotNull<T>(T, String, String)
    Validator.NotEmpty<T>(T, String, String)
    Validator.Equals<T>(T, T, String, String)
    Validator.Equals<T, TE>(T, T, String)
    Validator.NotEquals<T>(T, T, String, String)
    Validator.VerifyNotContainsKey<TK, TV>(IDictionary<TK, TV>, TK)
    Validator.VerifyContainsKey<TK, TV>(IDictionary<TK, TV>, TK)
    Validator.VerifyContainsKey<TK, TV>(IReadOnlyDictionary<TK, TV>, TK)
    Validator.VerifyContains<T>(IEnumerable<T>, T)
    Back to top Copyright (c) Microsoft Corporation. All rights reserved.