Class CheckDictionary<K, V>
Dictionary implementation to detect when the collection is modified.
Inherited Members
Namespace: Evergine.Common.Collections
Assembly: Evergine.Common.dll
Syntax
public class CheckDictionary<K, V> : IDictionary<K, V>, ICollection<KeyValuePair<K, V>>, IEnumerable<KeyValuePair<K, V>>, IEnumerable
Type Parameters
Name | Description |
---|---|
K | Key type. |
V | Value type. |
Constructors
CheckDictionary()
Initializes a new instance of the CheckDictionary<K, V> class.
Declaration
public CheckDictionary()
Properties
Changed
Gets a value indicating whether this CheckDictionary<K, V> is changed.
Declaration
public bool Changed { get; }
Property Value
Type | Description |
---|---|
bool |
|
Count
Gets the count.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int | The count. |
IsReadOnly
Gets a value indicating whether this instance is read only.
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
|
this[K]
Gets or sets the value with the specified key.
Declaration
public V this[K key] { get; set; }
Parameters
Type | Name | Description |
---|---|---|
K | key | The key. |
Property Value
Type | Description |
---|---|
V | The value. |
Keys
Gets the keys.
Declaration
public ICollection<K> Keys { get; }
Property Value
Type | Description |
---|---|
ICollection<K> | The keys. |
Values
Gets the values.
Declaration
public ICollection<V> Values { get; }
Property Value
Type | Description |
---|---|
ICollection<V> | The values. |
Methods
Add(KeyValuePair<K, V>)
Adds the specified item.
Declaration
public void Add(KeyValuePair<K, V> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | item | The item. |
Add(K, V)
Adds the specified key.
Declaration
public void Add(K key, V value)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key. |
V | value | The value. |
Clear()
Clears this instance.
Declaration
public void Clear()
Contains(KeyValuePair<K, V>)
Determines whether [contains] [the specified item].
Declaration
public bool Contains(KeyValuePair<K, V> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | item | The item. |
Returns
Type | Description |
---|---|
bool |
|
ContainsKey(K)
Determines whether the specified key contains key.
Declaration
public bool ContainsKey(K key)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key. |
Returns
Type | Description |
---|---|
bool |
|
CopyTo(KeyValuePair<K, V>[], int)
Copies to.
Declaration
public void CopyTo(KeyValuePair<K, V>[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V>[] | array | The array. |
int | arrayIndex | Index of the array. |
GetEnumerator()
Gets the enumerator.
Declaration
public IEnumerator<KeyValuePair<K, V>> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<KeyValuePair<K, V>> | the enumerator. |
Remove(KeyValuePair<K, V>)
Removes the specified item.
Declaration
public bool Remove(KeyValuePair<K, V> item)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V> | item | The item. |
Returns
Type | Description |
---|---|
bool | was removed. |
Remove(K)
Removes the specified key.
Declaration
public bool Remove(K key)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key. |
Returns
Type | Description |
---|---|
bool | true if was suscessfully removed. |
TryGetValue(K, out V)
Tries the get value.
Declaration
public bool TryGetValue(K key, out V value)
Parameters
Type | Name | Description |
---|---|---|
K | key | The key. |
V | value | The value. |
Returns
Type | Description |
---|---|
bool | true if value was retourned. |