Class WeakReferenceDictionary<TKey, TValue>
Represents a dictionary that holds WeakReferences to its values.
Inheritance
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll
Syntax
public class WeakReferenceDictionary<TKey, TValue> : Object, 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.
|
IsReadOnly
Gets a value indicating whether the dictionary is read-only.
Declaration
public bool IsReadOnly { get; }
Property Value
System.
|
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
|
Keys
Gets an ICollection containing the keys of the dictionary.
Declaration
public ICollection<TKey> Keys { get; }
Property Value
System.
|
Values
Gets an ICollection containing the values in the dictionary.
Declaration
public ICollection<TValue> Values { get; }
Property Value
System.
|
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. |
Clear()
Removes all keys and values from the dictionary.
Declaration
public void Clear()
Contains(KeyValuePair<TKey, TValue>)
Determines whether a sequence contains a specified element.
Declaration
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
System. The item. |
Returns
System.
|
ContainsKey(TKey)
Determines whether the dictionary contains the specified key.
Declaration
public bool ContainsKey(TKey key)
Parameters
TKey
key
The key. |
Returns
System.
|
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. The array. |
System. Index of the array. |
GetEnumerator()
Returns an enumerator that iterates through the dictionary.
Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
System.
|
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.
|
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.
|