Table of Contents

Class DictExtensions

Namespace
Vintagestory.API.Util
Assembly
VintagestoryAPI.dll
public static class DictExtensions
Inheritance
DictExtensions
Inherited Members

Methods

AddRange<K, V>(IDictionary<K, V>, IDictionary<K, V>)

Add several elements to dict

public static void AddRange<K, V>(this IDictionary<K, V> dict, IDictionary<K, V> elems)

Parameters

dict IDictionary<K, V>
elems IDictionary<K, V>

Type Parameters

K
V

Get<K, V>(IDictionary<K, V>, K, V)

Get value or defaultValue if key does not exists

public static V Get<K, V>(this IDictionary<K, V> dict, K key, V defaultValue = default)

Parameters

dict IDictionary<K, V>
key K
defaultValue V

Returns

V

Type Parameters

K
V

RemoveAllByKey<K, V>(IDictionary<K, V>, Func<K, bool>)

public static void RemoveAllByKey<K, V>(this IDictionary<K, V> dict, Func<K, bool> predicate)

Parameters

dict IDictionary<K, V>
predicate Func<K, bool>

Type Parameters

K
V

RemoveAll<K, V>(IDictionary<K, V>, Func<K, V, bool>)

public static void RemoveAll<K, V>(this IDictionary<K, V> dict, Func<K, V, bool> predicate)

Parameters

dict IDictionary<K, V>
predicate Func<K, V, bool>

Type Parameters

K
V

Remove<K, V>(ConcurrentDictionary<K, V>, K)

public static void Remove<K, V>(this ConcurrentDictionary<K, V> dict, K key)

Parameters

dict ConcurrentDictionary<K, V>
key K

Type Parameters

K
V