Class WeakReferenceDictionary<TKey, TValue>
Represents a dictionary that holds WeakReferences to its values.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public class WeakReferenceDictionary<TKey, TValue> : IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
TKey
|
TValue
|
Constructors
WeakReferenceDictionary()
Initializes a new instance of the WeakReferenceDictionary class.
Declaration
public WeakReferenceDictionary()
Properties
Count
Gets the number of elements contained in the dictionary.
Declaration
public int Count { get; }
Property Value
System.Int32
|
Implements
IsReadOnly
Gets a value indicating whether the dictionary is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
System.Boolean
|
Implements
Item[TKey]
Gets or sets the value associated with the specified key.
Declaration
public TValue this[TKey key] { get; set; }
Parameters
TKey
key
|
Property Value
TValue
|
Implements
Keys
Gets an ICollection containing the keys of the dictionary.
Declaration
public ICollection<TKey> Keys { get; }
Property Value
System.Collections.Generic.ICollection<TKey>
|
Implements
Values
Gets an ICollection containing the values in the dictionary.
Declaration
public ICollection<TValue> Values { get; }
Property Value
System.Collections.Generic.ICollection<TValue>
|
Implements
Methods
Add(TKey, TValue)
Adds the specified key and value to the dictionary.
Declaration
public void Add(TKey key, TValue value)
Parameters
TKey
key
The key. |
TValue
value
The value. |
Implements
Clear()
Removes all keys and values from the dictionary.
Declaration
public void Clear()
Implements
Contains(KeyValuePair<TKey, TValue>)
Determines whether a sequence contains a specified element.
Declaration
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
System.Collections.Generic.KeyValuePair<TKey, TValue>
item
The item. |
Returns
System.Boolean
|
Implements
ContainsKey(TKey)
Determines whether the dictionary contains the specified key.
Declaration
public bool ContainsKey(TKey key)
Parameters
TKey
key
The key. |
Returns
System.Boolean
|
Implements
CopyTo(KeyValuePair<TKey, TValue>[], Int32)
Copies the elements of the dictionary to an array, starting at a particular index.
Declaration
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
System.Collections.Generic.KeyValuePair<TKey, TValue>[]
array
The array. |
System.Int32
arrayIndex
Index of the array. |
Implements
GetEnumerator()
Returns an enumerator that iterates through the dictionary.
Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>>
|
Implements
Remove(TKey)
Removes the value with the specified key from the dictionary.
Declaration
public bool Remove(TKey key)
Parameters
TKey
key
The key. |
Returns
System.Boolean
|
Implements
TryGetValue(TKey, out TValue)
Gets the value associated with the specified key.
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
TKey
key
The key. |
TValue
value
The value. |
Returns
System.Boolean
|
Implements
Explicit Interface Implementations
ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue>)
Adds an element with the provided key and value to the dictionary.
Declaration
void ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue> item)
Parameters
System.Collections.Generic.KeyValuePair<TKey, TValue>
item
The item. |
Implements
ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue>)
Removes the first occurrence of a specified object from the dictionary.
Declaration
bool ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue> item)
Parameters
System.Collections.Generic.KeyValuePair<TKey, TValue>
item
The item. |
Returns
System.Boolean
|
Implements
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
System.Collections.IEnumerator
|