Class DictionaryExtensions
SC4X System.Collections.Generic.Dictionary extensions
public static class DictionaryExtensions
- Inheritance
-
DictionaryExtensions
- Inherited Members
Methods
AddSafe<T, TY>(Dictionary<T, TY>, T, TY)
Safely adds a value to a dictionary.
public static void AddSafe<T, TY>(this Dictionary<T, TY> dictionary, T key, TY value) where T : notnull
Parameters
dictionary
Dictionary<T, TY>the dictionary in question
key
Tthe key to insert at
value
TYthe value to insert
Type Parameters
T
type of the dictionary's keys
TY
type of the dictionary's values
ContainsKeys<T, TY>(Dictionary<T, TY>, params T[])
Determines whether a large number of keys are present in a given dictionary.
public static bool ContainsKeys<T, TY>(this Dictionary<T, TY> dictionary, params T[] keys) where T : notnull
Parameters
dictionary
Dictionary<T, TY>keys
T[]an array of keys of the type from the specified dictionary.
Returns
Type Parameters
T
TY