/// <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); }
/// <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)); }
/// <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); }
/// <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(); }
/// <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); }
/// <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)); }
/// <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)); }
/// <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)); }
// 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); }
/// <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)); }
/// <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); }
/// <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()); }
/// <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); }
/// <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); }
/// <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)); }
/// <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)); }
/// <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(); }