Show / Hide Table of Contents

Class CachingDictionary<K, V>

Dictionary wrapper that allows for addition and removal even during enumeration. Done by caching changes and allowing explicit application using Apply* methods.

Inheritance
System.Object
CachingDictionary<K, V>
Namespace: VRage.Collections
Assembly: VRage.Library.dll
Syntax
public class CachingDictionary<K, V> : Object, IEnumerable<KeyValuePair<K, V>>, IEnumerable
Type Parameters
Name Description
K
V

Constructors

CachingDictionary()

Declaration
public CachingDictionary()

Properties

Item[K]

Declaration
public V this[K key] { get; set; }
Parameters
Type Name Description
K key
Property Value
Type Description
V

Keys

Declaration
public Dictionary<K, V>.KeyCollection Keys { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary.KeyCollection<>

Reader

Declaration
public DictionaryReader<K, V> Reader { get; }
Property Value
Type Description
DictionaryReader<K, V>

Values

Declaration
public Dictionary<K, V>.ValueCollection Values { get; }
Property Value
Type Description
System.Collections.Generic.Dictionary.ValueCollection<>

Methods

Add(K, V, Boolean)

Declaration
public void Add(K key, V value, bool immediate = false)
Parameters
Type Name Description
K key
V value
System.Boolean immediate

ApplyAdditionsAndModifications()

Declaration
public void ApplyAdditionsAndModifications()

ApplyChanges()

Declaration
public void ApplyChanges()

ApplyRemovals()

Declaration
public void ApplyRemovals()

Clear()

Declaration
public void Clear()

ContainsKey(K)

Declaration
public bool ContainsKey(K key)
Parameters
Type Name Description
K key
Returns
Type Description
System.Boolean

GetEnumerator()

Declaration
public Dictionary<K, V>.Enumerator GetEnumerator()
Returns
Type Description
System.Collections.Generic.Dictionary.Enumerator<>

HasChanges()

Declaration
public bool HasChanges()
Returns
Type Description
System.Boolean

Remove(K, Boolean)

Declaration
public void Remove(K key, bool immediate = false)
Parameters
Type Name Description
K key
System.Boolean immediate

TryGetValue(K, out V)

Declaration
public bool TryGetValue(K key, out V value)
Parameters
Type Name Description
K key
V value
Returns
Type Description
System.Boolean
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾