/// <summary> /// Gets the total number of elements the internal data structure can hold without resizing. /// </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 int get_Capacity(SystemGenerics.List <T> list) #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 { (list as Mock)?.CheckDataRace(false); return(list.Capacity); }
/// <summary> /// Sets the element at the specified index. /// </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 void set_Item(SystemGenerics.List <T> list, int index, T value) #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 { (list as Mock)?.CheckDataRace(true); list[index] = value; }
/// <summary> /// Searches the entire sorted list for an element using the default /// comparer and returns the zero-based index of the element. /// </summary> public static void BinarySearch(SystemGenerics.List <T> list, T item) { (list as Mock)?.CheckDataRace(false); list.BinarySearch(item); }
/// <summary> /// Sets the capacity to the actual number of elements in the list, /// if that number is less than a threshold value. /// </summary> public static void TrimExcess(SystemGenerics.List <T> list) { (list as Mock)?.CheckDataRace(true); list.TrimExcess(); }
/// <summary> /// Sorts the elements in the entire list using the specified comparer. /// </summary> public static void Sort(SystemGenerics.List <T> list, SystemGenerics.IComparer <T> comparer) { (list as Mock)?.CheckDataRace(true); list.Sort(comparer); }
/// <summary> /// Sorts the elements in the entire list using the specified <see cref="Comparison{T}"/>. /// </summary> public static void Sort(SystemGenerics.List <T> list, Comparison <T> comparison) { (list as Mock)?.CheckDataRace(true); list.Sort(comparison); }
/// <summary> /// Reverses the order of the elements in the specified range. /// </summary> public static void Reverse(SystemGenerics.List <T> list, int index, int count) { (list as Mock)?.CheckDataRace(true); list.Reverse(index, count); }
/// <summary> /// Removes all the elements that match the conditions defined by the specified predicate. /// </summary> public static int RemoveAll(SystemGenerics.List <T> list, Predicate <T> match) { (list as Mock)?.CheckDataRace(true); return(list.RemoveAll(match)); }
/// <summary> /// Searches for an element that matches the conditions defined by the specified /// predicate, and returns the zero-based index of the first occurrence within the /// range of elements in the list that starts at the specified index and contains /// the specified number of elements. /// </summary> public static int FindIndex(SystemGenerics.List <T> list, int startIndex, int count, Predicate <T> match) { (list as Mock)?.CheckDataRace(false); return(list.FindIndex(startIndex, count, match)); }
/// <summary> /// Copies a range of elements from the list to a compatible one-dimensional array, /// starting at the specified index of the target array. /// </summary> public static void CopyTo(SystemGenerics.List <T> list, int index, T[] array, int arrayIndex, int count) { (list as Mock)?.CheckDataRace(false); list.CopyTo(index, array, arrayIndex, count); }
/// <summary> /// Copies the entire list to a compatible one-dimensional array, /// starting at the beginning of the target array. /// </summary> public static void CopyTo(SystemGenerics.List <T> list, T[] array) { (list as Mock)?.CheckDataRace(false); list.CopyTo(array); }
/// <summary> /// Converts the elements in the current list to another type, /// and returns a list containing the converted elements. /// </summary> public static SystemGenerics.List <TOutput> ConvertAll <TOutput>( SystemGenerics.List <T> list, Converter <T, TOutput> converter) { (list as Mock)?.CheckDataRace(false); return(list.ConvertAll(converter)); }
/// <summary> /// Determines whether an element is in the list. /// </summary> public static bool Contains(SystemGenerics.List <T> list, T item) { (list as Mock)?.CheckDataRace(false); return(list.Contains(item)); }
/// <summary> /// Removes all elements from the list. /// </summary> public static void Clear(SystemGenerics.List <T> list) { (list as Mock)?.CheckDataRace(true); list.Clear(); }
/// <summary> /// Searches a range of elements in the sorted list for an element using the /// specified comparer and returns the zero-based index of the element. /// </summary> public static void BinarySearch(SystemGenerics.List <T> list, int index, int count, T item, SystemGenerics.IComparer <T> comparer) { (list as Mock)?.CheckDataRace(false); list.BinarySearch(index, count, item, comparer); }
/// <summary> /// Searches for the specified object and returns the zero-based index of the last /// occurrence within the range of elements in the list that contains the specified /// number of elements and ends at the specified index. /// </summary> public static int LastIndexOf(SystemGenerics.List <T> list, T item, int index, int count) { (list as Mock)?.CheckDataRace(false); return(list.LastIndexOf(item, index, count)); }
/// <summary> /// Removes the first occurrence of a specific object from the list. /// </summary> public static bool Remove(SystemGenerics.List <T> list, T item) { (list as Mock)?.CheckDataRace(true); return(list.Remove(item)); }
/// <summary> /// Searches for an element that matches the conditions defined by the specified /// predicate, and returns the zero-based index of the last occurrence within the /// entire list. /// </summary> public static int FindLastIndex(SystemGenerics.List <T> list, Predicate <T> match) { (list as Mock)?.CheckDataRace(false); return(list.FindLastIndex(match)); }
/// <summary> /// Removes the element at the specified index of the list. /// </summary> public static void RemoveAt(SystemGenerics.List <T> list, int index) { (list as Mock)?.CheckDataRace(true); list.RemoveAt(index); }
/// <summary> /// Performs the specified action on each element of the list. /// </summary> public static void ForEach(SystemGenerics.List <T> list, Action <T> action) { (list as Mock)?.CheckDataRace(false); list.ForEach(action); }
/// <summary> /// Reverses the order of the elements in the entire list. /// </summary> public static void Reverse(SystemGenerics.List <T> list) { (list as Mock)?.CheckDataRace(true); list.Reverse(); }
/// <summary> /// Returns an enumerator that iterates through the list. /// </summary> public static SystemGenerics.List <T> .Enumerator GetEnumerator(SystemGenerics.List <T> list) { (list as Mock)?.CheckDataRace(false); return(list.GetEnumerator()); }
/// <summary> /// Sorts the elements in the entire list using the default comparer. /// </summary> public static void Sort(SystemGenerics.List <T> list) { (list as Mock)?.CheckDataRace(true); list.Sort(); }
/// <summary> /// Creates a shallow copy of a range of elements in the source list. /// </summary> public static SystemGenerics.List <T> GetRange(SystemGenerics.List <T> list, int index, int count) { (list as Mock)?.CheckDataRace(false); return(list.GetRange(index, count)); }
/// <summary> /// Copies the elements of the list to a new array. /// </summary> public static T[] ToArray(SystemGenerics.List <T> list) { (list as Mock)?.CheckDataRace(false); return(list.ToArray()); }
/// <summary> /// Searches for the specified object and returns the zero-based index of the first /// occurrence within the entire list. /// </summary> public static int IndexOf(SystemGenerics.List <T> list, T item) { (list as Mock)?.CheckDataRace(false); return(list.IndexOf(item)); }
/// <summary> /// Determines whether every element in the list matches /// the conditions defined by the specified predicate. /// </summary> public static bool TrueForAll(SystemGenerics.List <T> list, Predicate <T> match) { (list as Mock)?.CheckDataRace(false); return(list.TrueForAll(match)); }
/// <summary> /// Inserts an element into the list at the specified index. /// </summary> public static void Insert(SystemGenerics.List <T> list, int index, T item) { (list as Mock)?.CheckDataRace(true); list.Insert(index, item); }
/// <summary> /// Inserts the elements of a collection into the list /// at the specified index. /// </summary> public static void InsertRange(SystemGenerics.List <T> list, int index, SystemGenerics.IEnumerable <T> collection) { (list as Mock)?.CheckDataRace(true); list.InsertRange(index, collection); }
/// <summary> /// Adds the elements of the specified collection to the end of the list. /// </summary> public static void AddRange(SystemGenerics.List <T> list, SystemGenerics.IEnumerable <T> collection) { (list as Mock)?.CheckDataRace(true); list.AddRange(collection); }