Class CheckDictionary<K, V>
Dictionary implementation to detect when the collection is modified.
Namespace: Evergine.Common.Collections
Assembly: Evergine.Common.dll
Syntax
public class CheckDictionary<K, V>
Type Parameters
Name | Description |
---|---|
K | The key type. |
V | The 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> has 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 specified item to be added. |
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 the instance.
Declaration
public void Clear()
Contains(KeyValuePair<K, V>)
Determines whether the specified item is contained.
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 the 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 the specified array.
Declaration
public void CopyTo(KeyValuePair<K, V>[] array, int arrayIndex)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<K, V>[] | array | The destination array. |
int | arrayIndex | The starting index in 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 | Item 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 successfully removed. |
TryGetValue(K, out V)
Tries to get the 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 the value was returned. |