/// <summary> /// Gets the value associated with the specified key. /// </summary> #pragma warning disable CA1707 // Identifiers should not contain underscores #pragma warning disable SA1300 // Element should begin with upper-case letter #pragma warning disable IDE1006 // Naming Styles public static TValue get_Item(SystemGenerics.Dictionary <TKey, TValue> dictionary, TKey key) #pragma warning restore IDE1006 // Naming Styles #pragma warning restore SA1300 // Element should begin with upper-case letter #pragma warning restore CA1707 // Identifiers should not contain underscores { (dictionary as Mock)?.CheckDataRace(false); return(dictionary[key]); }
/// <summary> /// Sets the capacity of this dictionary to hold up a specified number of entries /// without any further expansion of its backing storage. /// </summary> public static void TrimExcess(SystemGenerics.Dictionary <TKey, TValue> dictionary, int size) { (dictionary as Mock)?.CheckDataRace(true); dictionary.TrimExcess(size); }
/// <summary> /// Attempts to add the specified key and value to the dictionary. /// </summary> public static bool TryAdd(SystemGenerics.Dictionary <TKey, TValue> dictionary, TKey key, TValue value) { (dictionary as Mock)?.CheckDataRace(true); return(dictionary.TryAdd(key, value)); }
/// <summary> /// Ensures that the dictionary can hold up to a specified number of entries without /// any further expansion of its backing storage. /// </summary> public static void EnsureCapacity(SystemGenerics.Dictionary <TKey, TValue> dictionary, int size) { (dictionary as Mock)?.CheckDataRace(true); dictionary.EnsureCapacity(size); }
/// <summary> /// Removes the value with the specified key from the dictionary. /// </summary> public static bool Remove(SystemGenerics.Dictionary <TKey, TValue> dictionary, TKey key, out TValue value) { (dictionary as Mock)?.CheckDataRace(true); return(dictionary.Remove(key, out value)); }
/// <summary> /// Implements the <see cref="ISerializable"/> interface and returns the data needed /// to serialize the dictionary instance. /// </summary> public static void GetObjectData(SystemGenerics.Dictionary <TKey, TValue> dictionary, SerializationInfo info, StreamingContext context) { (dictionary as Mock)?.CheckDataRace(true); dictionary.GetObjectData(info, context); }
/// <summary> /// Implements the <see cref="ISerializable"/> interface and raises /// the deserialization event when the deserialization is complete. /// </summary> public static void OnDeserialization(SystemGenerics.Dictionary <TKey, TValue> dictionary, object sender) { (dictionary as Mock)?.CheckDataRace(true); dictionary.OnDeserialization(sender); }
/// <summary> /// Gets the value associated with the specified key. /// </summary> public static bool TryGetValue(SystemGenerics.Dictionary <TKey, TValue> dictionary, TKey key, out TValue value) { (dictionary as Mock)?.CheckDataRace(false); return(dictionary.TryGetValue(key, out value)); }
/// <summary> /// Returns an enumerator that iterates through the dictionary. /// </summary> public static SystemGenerics.Dictionary <TKey, TValue> .Enumerator GetEnumerator( SystemGenerics.Dictionary <TKey, TValue> dictionary) { (dictionary as Mock)?.CheckDataRace(false); return(dictionary.GetEnumerator()); }
/// <summary> /// Determines whether the dictionary contains a specific value. /// </summary> public static bool ContainsValue(SystemGenerics.Dictionary <TKey, TValue> dictionary, TValue value) { (dictionary as Mock)?.CheckDataRace(false); return(dictionary.ContainsValue(value)); }
/// <summary> /// Removes all keys and values from the dictionary. /// </summary> public static void Clear(SystemGenerics.Dictionary <TKey, TValue> dictionary) { (dictionary as Mock)?.CheckDataRace(true); dictionary.Clear(); }
/// <summary> /// Adds the specified key and value to the dictionary. /// </summary> public static void Add(SystemGenerics.Dictionary <TKey, TValue> dictionary, TKey key, TValue value) { (dictionary as Mock)?.CheckDataRace(true); dictionary.Add(key, value); }