Пример #1
0
        /// <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]);
        }
Пример #2
0
 /// <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);
 }
Пример #3
0
 /// <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));
 }
Пример #4
0
 /// <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);
 }
Пример #5
0
 /// <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));
 }
Пример #6
0
 /// <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);
 }
Пример #7
0
 /// <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);
 }
Пример #8
0
 /// <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));
 }
Пример #9
0
 /// <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());
 }
Пример #10
0
 /// <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));
 }
Пример #11
0
 /// <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();
 }
Пример #12
0
 /// <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);
 }