Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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;
        }
Пример #3
0
 /// <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);
 }
Пример #4
0
 /// <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();
 }
Пример #5
0
 /// <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);
 }
Пример #6
0
 /// <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);
 }
Пример #7
0
 /// <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);
 }
Пример #8
0
 /// <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));
 }
Пример #9
0
 /// <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));
 }
Пример #10
0
 /// <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);
 }
Пример #11
0
 /// <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);
 }
Пример #12
0
 /// <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));
 }
Пример #13
0
 /// <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));
 }
Пример #14
0
 /// <summary>
 /// Removes all elements from the list.
 /// </summary>
 public static void Clear(SystemGenerics.List <T> list)
 {
     (list as Mock)?.CheckDataRace(true);
     list.Clear();
 }
Пример #15
0
 /// <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);
 }
Пример #16
0
 /// <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));
 }
Пример #17
0
 /// <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));
 }
Пример #18
0
 /// <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));
 }
Пример #19
0
 /// <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);
 }
Пример #20
0
 /// <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);
 }
Пример #21
0
 /// <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();
 }
Пример #22
0
 /// <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());
 }
Пример #23
0
 /// <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();
 }
Пример #24
0
 /// <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));
 }
Пример #25
0
 /// <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());
 }
Пример #26
0
 /// <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));
 }
Пример #27
0
 /// <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));
 }
Пример #28
0
 /// <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);
 }
Пример #29
0
 /// <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);
 }
Пример #30
0
 /// <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);
 }