Class ReadOnlyDictionary<TKey,TValue>

This class implements a read-only dictionary.

System.Object
  Stonefield.Collections.ReadOnlyDictionary<TKey,TValue>
public class ReadOnlyDictionary<TKey,TValue> : object, IDictionary<TKey,
   TValue>,
   ICollection<KeyValuePair`2>,
   IEnumerable<KeyValuePair`2>,
   IEnumerable

Class Members

MemberDescription

Constructor

Add

Adds an item to the dictionary.

public sealed void Add(TKey key,
    TValue value);

public sealed void Add(KeyValuePair<TKey,TValue> item);

public sealed void Add(KeyValuePair<TKey,TValue> item)

Clear

Clears the dictionary.

public sealed void Clear();

Contains

public sealed bool Contains(KeyValuePair<TKey,TValue> item);

public sealed bool Contains(KeyValuePair<TKey,TValue> item)

ContainsKey

Determines if the specified key exists.

public sealed bool ContainsKey(TKey key);

CopyTo

public sealed void CopyTo(KeyValuePair`2[] array,
    int arrayIndex);

public sealed void CopyTo(KeyValuePair<TKey,TValue> array,
    int arrayIndex)

GetEnumerator

Gets the enumerator.

public sealed IEnumerator<KeyValuePair`2> GetEnumerator();

Remove

Removes an item from the dictionary.

public sealed bool Remove(TKey key);

public sealed bool Remove(KeyValuePair<TKey,TValue> item);

public sealed bool Remove(KeyValuePair<TKey,TValue> item)

TryGetValue

public sealed bool TryGetValue(TKey key,
    ref TValue value);

public sealed bool TryGetValue(TKey key,
    ref TValue& value)

Count

The number of items in the dictionary.

IsReadOnly

True since this is a read-only dictionary.

Item

Keys

The keys for the dictionary.

Values

The values for the dictionary.

Requirements

Namespace: Stonefield.Collections
Assembly: collections.dll