Class EventedDictionary<TKey, TValue, TContext>
Represents a dictionary that rises events
Inheritance
System.Object
EventedDictionary<TKey, TValue, TContext>
Implements
System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.IEnumerable
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Azos.dll
Syntax
[Serializable]
public class EventedDictionary<TKey, TValue, TContext> : EventedCollectionBase<TContext>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
TContext |
|
Constructors
EventedDictionary()
Initializes a new instance that is empty, has the default initial capacity, and uses the default
equality comparer for the key type.
Declaration
public EventedDictionary()
EventedDictionary(TContext, Boolean)
Initializes a new instance that is empty, has the default initial capacity, and uses the default
equality comparer for the key type.
Declaration
public EventedDictionary(TContext context, bool contextReadOnly)
Parameters
Type |
Name |
Description |
TContext |
context |
|
System.Boolean |
contextReadOnly |
|
EventedDictionary(TContext, Boolean, IDictionary<TKey, TValue>)
Initializes a new instance that contains elements copied from the specified IDictionary[TKey,TValue]
and uses the default equality comparer for the key type.
Declaration
public EventedDictionary(TContext context, bool contextReadOnly, IDictionary<TKey, TValue> dictionary)
Parameters
Type |
Name |
Description |
TContext |
context |
|
System.Boolean |
contextReadOnly |
|
System.Collections.Generic.IDictionary<TKey, TValue> |
dictionary |
|
EventedDictionary(TContext, Boolean, IDictionary<TKey, TValue>, IEqualityComparer<TKey>)
Initializes a new instance that contains elements copied from the specified IDictionary[TKey,TValue]
and uses the specified IEqualityComparer[T].
Declaration
public EventedDictionary(TContext context, bool contextReadOnly, IDictionary<TKey, TValue> dictionary, IEqualityComparer<TKey> comparer)
Parameters
Type |
Name |
Description |
TContext |
context |
|
System.Boolean |
contextReadOnly |
|
System.Collections.Generic.IDictionary<TKey, TValue> |
dictionary |
|
System.Collections.Generic.IEqualityComparer<TKey> |
comparer |
|
EventedDictionary(TContext, Boolean, IEqualityComparer<TKey>)
Initializes a new instance that is empty, has the default initial capacity, and uses the specified
IEqualityComparer[T].
Declaration
public EventedDictionary(TContext context, bool contextReadOnly, IEqualityComparer<TKey> comparer)
Parameters
Type |
Name |
Description |
TContext |
context |
|
System.Boolean |
contextReadOnly |
|
System.Collections.Generic.IEqualityComparer<TKey> |
comparer |
|
EventedDictionary(TContext, Boolean, Int32)
Initializes a new instance that is empty, has the specified initial capacity, and uses the default
equality comparer for the key type.
Declaration
public EventedDictionary(TContext context, bool contextReadOnly, int capacity)
Parameters
Type |
Name |
Description |
TContext |
context |
|
System.Boolean |
contextReadOnly |
|
System.Int32 |
capacity |
|
EventedDictionary(TContext, Boolean, Int32, IEqualityComparer<TKey>)
Initializes a new instance of the Dictionary[TKey,TValue]
class that is empty, has the specified initial capacity, and uses the specified IEqualityComparer[T]
Declaration
public EventedDictionary(TContext context, bool contextReadOnly, int capacity, IEqualityComparer<TKey> comparer)
Parameters
Type |
Name |
Description |
TContext |
context |
|
System.Boolean |
contextReadOnly |
|
System.Int32 |
capacity |
|
System.Collections.Generic.IEqualityComparer<TKey> |
comparer |
|
Fields
ChangeEvent
Declaration
[NonSerialized]
public EventedDictionary<TKey, TValue, TContext>.ChangeHandler ChangeEvent
Field Value
Properties
Count
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
Item[TKey]
Declaration
public TValue this[TKey key] { get; set; }
Parameters
Type |
Name |
Description |
TKey |
key |
|
Property Value
Keys
Declaration
public ICollection<TKey> Keys { get; }
Property Value
Type |
Description |
System.Collections.Generic.ICollection<TKey> |
|
Values
Declaration
public ICollection<TValue> Values { get; }
Property Value
Type |
Description |
System.Collections.Generic.ICollection<TValue> |
|
Methods
Add(TKey, TValue)
Declaration
public void Add(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Add(KeyValuePair<TKey, TValue>)
Declaration
public void Add(KeyValuePair<TKey, TValue> item)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<TKey, TValue> |
item |
|
Clear()
Declaration
Contains(KeyValuePair<TKey, TValue>)
Declaration
public bool Contains(KeyValuePair<TKey, TValue> item)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<TKey, TValue> |
item |
|
Returns
Type |
Description |
System.Boolean |
|
ContainsKey(TKey)
Declaration
public bool ContainsKey(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
Type |
Description |
System.Boolean |
|
CopyTo(KeyValuePair<TKey, TValue>[], Int32)
Declaration
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<TKey, TValue>[] |
array |
|
System.Int32 |
arrayIndex |
|
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
|
Remove(TKey)
Declaration
public bool Remove(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
Type |
Description |
System.Boolean |
|
Remove(KeyValuePair<TKey, TValue>)
Declaration
public bool Remove(KeyValuePair<TKey, TValue> item)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<TKey, TValue> |
item |
|
Returns
Type |
Description |
System.Boolean |
|
TryGetValue(TKey, out TValue)
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
Implements
System.Collections.Generic.IDictionary<TKey, TValue>
System.Collections.Generic.ICollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable
Extension Methods