Class
WeakReferenceDictionary<TKey, TValue>

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:

cs-api-definition
public class WeakReferenceDictionary<TKey, TValue> : IEnumerable

Inheritance: objectWeakReferenceDictionary<TKey, TValue>

Implements: IEnumerable

Constructors

WeakReferenceDictionary()

Initializes a new instance of the WeakReferenceDictionary class.

Declaration

cs-api-definition
public WeakReferenceDictionary()

Properties

Count

Gets the number of elements contained in the dictionary.

Declaration

cs-api-definition
public int Count { get; }

Property Value

int

IsReadOnly

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

Declaration

cs-api-definition
public bool IsReadOnly { get; }

Property Value

bool

Keys

Gets an ICollection containing the keys of the dictionary.

Declaration

cs-api-definition
public ICollection<TKey> Keys { get; }

Property Value

ICollection<TKey>

Values

Gets an ICollection containing the values in the dictionary.

Declaration

cs-api-definition
public ICollection<TValue> Values { get; }

Property Value

ICollection<TValue>

this[TKey]

Gets or sets the value associated with the specified key.

Declaration

cs-api-definition
public TValue this[TKey key] { get; set; }

Parameters

key

TKey

Property Value

TValue

Methods

Add(TKey, TValue)

Adds the specified key and value to the dictionary.

Declaration

cs-api-definition
public void Add(TKey key, TValue value)

Parameters

key

TKey

The key.

value

TValue

The value.

Clear()

Removes all keys and values from the dictionary.

Declaration

cs-api-definition
public void Clear()

Contains(KeyValuePair<TKey, TValue>)

Determines whether a sequence contains a specified element.

Declaration

cs-api-definition
public bool Contains(KeyValuePair<TKey, TValue> item)

Parameters

item

KeyValuePair<TKey, TValue>

The item.

Returns

bool

ContainsKey(TKey)

Determines whether the dictionary contains the specified key.

Declaration

cs-api-definition
public bool ContainsKey(TKey key)

Parameters

key

TKey

The key.

Returns

bool

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

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

Declaration

cs-api-definition
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)

Parameters

array

KeyValuePair<TKey, TValue>[]

The array.

arrayIndex

int

Index of the array.

GetEnumerator()

Returns an enumerator that iterates through the dictionary.

Declaration

cs-api-definition
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()

Returns

IEnumerator<KeyValuePair<TKey, TValue>>

Remove(TKey)

Removes the value with the specified key from the dictionary.

Declaration

cs-api-definition
public bool Remove(TKey key)

Parameters

key

TKey

The key.

Returns

bool

TryGetValue(TKey, out TValue)

Gets the value associated with the specified key.

Declaration

cs-api-definition
public bool TryGetValue(TKey key, out TValue value)

Parameters

key

TKey

The key.

value

TValue

The value.

Returns

bool