📄 undoredolist.cs
字号:
// comparer:
// The System.Collections.Generic.IComparer<T> implementation to use when comparing
// elements, or null to use the default comparer System.Collections.Generic.Comparer<T>.Default.
//
// Returns:
// The zero-based index of item in the sorted System.Collections.Generic.List<T>,
// if item is found; otherwise, a negative number that is the bitwise complement
// of the index of the next element that is larger than item or, if there is
// no larger element, the bitwise complement of System.Collections.Generic.List<T>.Count.
//
// Exceptions:
// System.ArgumentOutOfRangeException:
// index is less than 0.-or-count is less than 0.
//
// System.InvalidOperationException:
// comparer is null, and the default comparer System.Collections.Generic.Comparer<T>.Default
// cannot find an implementation of the System.IComparable<T> generic interface
// or the System.IComparable interface for type T.
//
// System.ArgumentException:
// index and count do not denote a valid range in the System.Collections.Generic.List<T>.
public int BinarySearch(int index, int count, T item, IComparer<T> comparer)
{
return list.BinarySearch(index, count, item, comparer);
}
//
///<summary>
// Removes all elements from the System.Collections.Generic.List<T>.
public void Clear()
{
Enlist(false);
}
//
///<summary>
// Determines whether an element is in the System.Collections.Generic.List<T>.
//
// Parameters:
// item:
// The object to locate in the System.Collections.Generic.List<T>. The value
// can be null for reference types.
//
// Returns:
// true if item is found in the System.Collections.Generic.List<T>; otherwise,
// false.
public bool Contains(T item)
{
return list.Contains(item);
}
//
///<summary>
// Converts the elements in the current System.Collections.Generic.List<T> to
// another type, and returns a list containing the converted elements.
//
// Parameters:
// converter:
// A System.Converter<TInput,TOutput> delegate that converts each element from
// one type to another type.
//
// Returns:
// A System.Collections.Generic.List<T> of the target type containing the converted
// elements from the current System.Collections.Generic.List<T>.
//
// Exceptions:
// System.ArgumentNullException:
// converter is null.
public List<TOutput> ConvertAll<TOutput>(Converter<T, TOutput> converter)
{
return list.ConvertAll<TOutput>(converter);
}
//
///<summary>
// Copies the entire System.Collections.Generic.List<T> to a compatible one-dimensional
// array, starting at the beginning of the target array.
//
// Parameters:
// array:
// The one-dimensional System.Array that is the destination of the elements
// copied from System.Collections.Generic.List<T>. The System.Array must have
// zero-based indexing.
//
// Exceptions:
// System.ArgumentException:
// The number of elements in the source System.Collections.Generic.List<T> is
// greater than the number of elements that the destination array can contain.
//
// System.ArgumentNullException:
// array is null.
public void CopyTo(T[] array)
{
list.CopyTo(array);
}
//
///<summary>
// Copies the entire System.Collections.Generic.List<T> to a compatible one-dimensional
// array, starting at the specified index of the target array.
//
// Parameters:
// array:
// The one-dimensional System.Array that is the destination of the elements
// copied from System.Collections.Generic.List<T>. The System.Array must have
// zero-based indexing.
//
// arrayIndex:
// The zero-based index in array at which copying begins.
//
// Exceptions:
// System.ArgumentException:
// arrayIndex is equal to or greater than the length of array.-or-The number
// of elements in the source System.Collections.Generic.List<T> is greater than
// the available space from arrayIndex to the end of the destination array.
//
// System.ArgumentOutOfRangeException:
// arrayIndex is less than 0.
//
// System.ArgumentNullException:
// array is null.
public void CopyTo(T[] array, int arrayIndex)
{
list.CopyTo(array, arrayIndex);
}
//
///<summary>
// Copies a range of elements from the System.Collections.Generic.List<T> to
// a compatible one-dimensional array, starting at the specified index of the
// target array.
//
// Parameters:
// array:
// The one-dimensional System.Array that is the destination of the elements
// copied from System.Collections.Generic.List<T>. The System.Array must have
// zero-based indexing.
//
// count:
// The number of elements to copy.
//
// arrayIndex:
// The zero-based index in array at which copying begins.
//
// index:
// The zero-based index in the source System.Collections.Generic.List<T> at
// which copying begins.
//
// Exceptions:
// System.ArgumentNullException:
// array is null.
//
// System.ArgumentOutOfRangeException:
// index is less than 0.-or-arrayIndex is less than 0.-or-count is less than
// 0.
//
// System.ArgumentException:
// index is equal to or greater than the System.Collections.Generic.List<T>.Count
// of the source System.Collections.Generic.List<T>.-or-arrayIndex is equal
// to or greater than the length of array.-or-The number of elements from index
// to the end of the source System.Collections.Generic.List<T> is greater than
// the available space from arrayIndex to the end of the destination array.
public void CopyTo(int index, T[] array, int arrayIndex, int count)
{
list.CopyTo(index, array, arrayIndex, count);
}
//
///<summary>
// Determines whether the System.Collections.Generic.List<T> contains elements
// that match the conditions defined by the specified predicate.
//
// Parameters:
// match:
// The System.Predicate<T> delegate that defines the conditions of the elements
// to search for.
//
// Returns:
// true if the System.Collections.Generic.List<T> contains one or more elements
// that match the conditions defined by the specified predicate; otherwise,
// false.
//
// Exceptions:
// System.ArgumentNullException:
// match is null.
public bool Exists(Predicate<T> match)
{
return list.Exists(match);
}
//
///<summary>
// Searches for an element that matches the conditions defined by the specified
// predicate, and returns the first occurrence within the entire System.Collections.Generic.List<T>.
//
// Parameters:
// match:
// The System.Predicate<T> delegate that defines the conditions of the element
// to search for.
//
// Returns:
// The first element that matches the conditions defined by the specified predicate,
// if found; otherwise, the default value for type T.
//
// Exceptions:
// System.ArgumentNullException:
// match is null.
public T Find(Predicate<T> match)
{
return list.Find(match);
}
//
///<summary>
// Retrieves the all the elements that match the conditions defined by the specified
// predicate.
//
// Parameters:
// match:
// The System.Predicate<T> delegate that defines the conditions of the elements
// to search for.
//
// Returns:
// A System.Collections.Generic.List<T> containing all the elements that match
// the conditions defined by the specified predicate, if found; otherwise, an
// empty System.Collections.Generic.List<T>.
//
// Exceptions:
// System.ArgumentNullException:
// match is null.
public List<T> FindAll(Predicate<T> match)
{
return list.FindAll(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 entire System.Collections.Generic.List<T>.
//
// Parameters:
// match:
// The System.Predicate<T> delegate that defines the conditions of the element
// to search for.
//
// Returns:
// The zero-based index of the first occurrence of an element that matches the
// conditions defined by match, if found; otherwise,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -