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