New to Telerik UI for WinForms? Start a free 30-day trial

Represents a dictionary that holds WeakReferences to its values.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.WinControls.RadDiagram.dll

Type Parameters:

TKey

TValue

Syntax:

C#
public class WeakReferenceDictionary<TKey, TValue> : IEnumerable

Inheritance: objectWeakReferenceDictionary<TKey, TValue>

Implements: IEnumerable

Constructors

Initializes a new instance of the WeakReferenceDictionary class.

C#
public WeakReferenceDictionary()

Properties

Gets the number of elements contained in the dictionary.

C#
public int Count { get; }

Gets a value indicating whether the dictionary is read-only.

C#
public bool IsReadOnly { get; }

Keys

ICollection<TKey>

Gets an ICollection containing the keys of the dictionary.

C#
public ICollection<TKey> Keys { get; }

Gets or sets the value associated with the specified key.

C#
public TValue this[TKey key] { get; set; }
Parameters:keyTKey

Values

ICollection<TValue>

Gets an ICollection containing the values in the dictionary.

C#
public ICollection<TValue> Values { get; }

Methods

Adds the specified key and value to the dictionary.

C#
public void Add(TKey key, TValue value)
Parameters:keyTKey

The key.

valueTValue

The value.

Removes all keys and values from the dictionary.

C#
public void Clear()

Determines whether a sequence contains a specified element.

C#
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters:itemKeyValuePair<TKey, TValue>

The item.

Returns:

bool

Determines whether the dictionary contains the specified key.

C#
public bool ContainsKey(TKey key)
Parameters:keyTKey

The key.

Returns:

bool

Copies the elements of the dictionary to an array, starting at a particular index.

C#
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters:arrayKeyValuePair<TKey, TValue>[]

The array.

arrayIndexint

Index of the array.

Returns an enumerator that iterates through the dictionary.

C#
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns:

IEnumerator<KeyValuePair<TKey, TValue>>

Removes the value with the specified key from the dictionary.

C#
public bool Remove(TKey key)
Parameters:keyTKey

The key.

Returns:

bool

Gets the value associated with the specified key.

C#
public bool TryGetValue(TKey key, out TValue value)
Parameters:keyTKey

The key.

valueTValue

The value.

Returns:

bool