Example #1
0
        /// <summary>
        /// Gets the equality comparer object that is used to determine equality for the values in the set.
        /// </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 SystemGenerics.IEqualityComparer <T> get_Comparer(SystemGenerics.HashSet <T> hashSet)
#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
        {
            (hashSet as Mock)?.CheckDataRace(false);
            return(hashSet.Comparer);
        }
Example #2
0
 /// <summary>
 /// Ensures that this hash set object can hold the specified number of elements without growing.
 /// </summary>
 public static int EnsureCapacity(SystemGenerics.HashSet <T> hashSet, int capacity)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     return(hashSet.EnsureCapacity(capacity));
 }
Example #3
0
 /// <summary>
 /// Modifies the current hash set object to contain all elements that are
 /// present in itself, the specified collection, or both.
 /// </summary>
 public static void UnionWith(SystemGenerics.HashSet <T> hashSet, SystemGenerics.IEnumerable <T> other)
 {
     (hashSet as Mock)?.CheckDataRace(true);
     hashSet.UnionWith(other);
 }
Example #4
0
 /// <summary>
 /// Sets the capacity of a hash set object to the actual number of elements it
 /// contains, rounded up to a nearby, implementation-specific value.
 /// </summary>
 public static void TrimExcess(SystemGenerics.HashSet <T> hashSet)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     hashSet.TrimExcess();
 }
Example #5
0
 /// <summary>
 /// Modifies the current hash set object to contain only elements that are present either in
 /// that object or in the specified collection, but not both.
 /// </summary>
 public static void SymmetricExceptWith(SystemGenerics.HashSet <T> hashSet, SystemGenerics.IEnumerable <T> other)
 {
     (hashSet as Mock)?.CheckDataRace(true);
     hashSet.SymmetricExceptWith(other);
 }
Example #6
0
 /// <summary>
 /// Determines whether a hash set object and the specified collection contain the same elements.
 /// </summary>
 public static bool SetEquals(SystemGenerics.HashSet <T> hashSet, SystemGenerics.IEnumerable <T> other)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     return(hashSet.SetEquals(other));
 }
Example #7
0
 /// <summary>
 /// Removes the specified element from a hash set object.
 /// </summary>
 public static int RemoveWhere(SystemGenerics.HashSet <T> hashSet, Predicate <T> match)
 {
     (hashSet as Mock)?.CheckDataRace(true);
     return(hashSet.RemoveWhere(match));
 }
Example #8
0
 /// <summary>
 /// Determines whether a hash set object contains the specified element.
 /// </summary>
 public static bool Contains(SystemGenerics.HashSet <T> hashSet, T item)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     return(hashSet.Contains(item));
 }
Example #9
0
        // TODO: Is this requried?

        /// <summary>
        /// Implements the <see cref="ISerializable"/> interface and raises the deserialization
        /// event when the deserialization is complete.
        /// </summary>
        public static void OnDeserialization(SystemGenerics.HashSet <T> hashSet, object sender)
        {
            (hashSet as Mock)?.CheckDataRace(false);
            hashSet.OnDeserialization(sender);
        }
Example #10
0
 /// <summary>
 /// Determines whether a hash set object is a superset of the specified collection.
 /// </summary>
 public static bool IsSupersetOf(SystemGenerics.HashSet <T> hashSet, SystemGenerics.IEnumerable <T> other)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     return(hashSet.IsSupersetOf(other));
 }
Example #11
0
 /// <summary>
 /// Implements the <see cref="ISerializable"/> interface and returns the data needed to
 /// serialize a hash set object.
 /// </summary>
 public static void GetObjectData(SystemGenerics.HashSet <T> hashSet, SerializationInfo info,
                                  StreamingContext context)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     hashSet.GetObjectData(info, context);
 }
Example #12
0
 /// <summary>
 /// Returns an enumerator that iterates through a hash set object.
 /// </summary>
 public static SystemGenerics.HashSet <T> .Enumerator GetEnumerator(SystemGenerics.HashSet <T> hashSet)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     return(hashSet.GetEnumerator());
 }
Example #13
0
 /// <summary>
 /// Copies the specified number of elements of a hash set object to an array, starting at the specified array index.
 /// </summary>
 public static void CopyTo(SystemGenerics.HashSet <T> hashSet, T[] array, int arrayIndex, int count)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     hashSet.CopyTo(array, arrayIndex, count);
 }
Example #14
0
 /// <summary>
 /// Copies the elements of a hash set object to an array.
 /// </summary>
 public static void CopyTo(SystemGenerics.HashSet <T> hashSet, T[] array)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     hashSet.CopyTo(array);
 }
Example #15
0
 /// <summary>
 /// Searches the set for a given value and returns the equal value it finds, if any.
 /// </summary>
 public static bool TryGetValue(SystemGenerics.HashSet <T> hashSet, T equalValue, out T actualValue)
 {
     (hashSet as Mock)?.CheckDataRace(false);
     return(hashSet.TryGetValue(equalValue, out actualValue));
 }
Example #16
0
 /// <summary>
 /// Removes the specified element from a hash set object.
 /// </summary>
 public static bool Remove(SystemGenerics.HashSet <T> hashSet, T item)
 {
     (hashSet as Mock)?.CheckDataRace(true);
     return(hashSet.Remove(item));
 }
Example #17
0
 /// <summary>
 /// Removes all elements from a hash set object.
 /// </summary>
 public static void Clear(SystemGenerics.HashSet <T> hashSet)
 {
     (hashSet as Mock)?.CheckDataRace(true);
     hashSet.Clear();
 }