📄 pagelocationcollection.cs
字号:
/// <exception cref="InvalidCastException"><paramref name="value"/>
/// is not compatible with <see cref="PageLocation"/>.</exception>
/// <exception cref="NotSupportedException">
/// <para>The <see cref="PageLocationCollection"/> is read-only.</para>
/// <para>-or-</para>
/// <para>The <b>PageLocationCollection</b> has a fixed size.</para></exception>
/// <remarks>Please refer to <see cref="ArrayList.Add"/> for details.</remarks>
int IList.Add(object value)
{
return Add((PageLocation) value);
}
#endregion
#region AddRange
/// <overloads>
/// Adds a range of elements to the end of the <see cref="PageLocationCollection"/>.
/// </overloads>
/// <summary>
/// Adds the elements of another collection to the end of the <see cref="PageLocationCollection"/>.
/// </summary>
/// <param name="collection">The <see cref="PageLocationCollection"/> whose elements
/// should be added to the end of the current collection.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="collection"/> is a null reference.</exception>
/// <exception cref="NotSupportedException">
/// <para>The <see cref="PageLocationCollection"/> is read-only.</para>
/// <para>-or-</para>
/// <para>The <b>PageLocationCollection</b> has a fixed size.</para></exception>
/// <remarks>Please refer to <see cref="ArrayList.AddRange"/> for details.</remarks>
public virtual void AddRange(PageLocationCollection collection)
{
if (collection == null)
throw new ArgumentNullException("collection");
if (collection.Count == 0)
return;
if (this._count + collection.Count > this._array.Length)
EnsureCapacity(this._count + collection.Count);
++this._version;
Array.Copy(collection._array, 0, this._array, this._count, collection.Count);
this._count += collection.Count;
}
/// <summary>
/// Adds the elements of a <see cref="PageLocation"/> array
/// to the end of the <see cref="PageLocationCollection"/>.
/// </summary>
/// <param name="array">An <see cref="Array"/> of <see cref="PageLocation"/> elements
/// that should be added to the end of the <see cref="PageLocationCollection"/>.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="array"/> is a null reference.</exception>
/// <exception cref="NotSupportedException">
/// <para>The <see cref="PageLocationCollection"/> is read-only.</para>
/// <para>-or-</para>
/// <para>The <b>PageLocationCollection</b> has a fixed size.</para></exception>
/// <remarks>Please refer to <see cref="ArrayList.AddRange"/> for details.</remarks>
public virtual void AddRange(PageLocation[] array)
{
if (array == null)
throw new ArgumentNullException("array");
if (array.Length == 0)
return;
if (this._count + array.Length > this._array.Length)
EnsureCapacity(this._count + array.Length);
++this._version;
Array.Copy(array, 0, this._array, this._count, array.Length);
this._count += array.Length;
}
#endregion
#region BinarySearch
/// <summary>
/// Searches the entire sorted <see cref="PageLocationCollection"/> for an
/// <see cref="PageLocation"/> element using the default comparer
/// and returns the zero-based index of the element.
/// </summary>
/// <param name="value">The <see cref="PageLocation"/> object
/// to locate in the <see cref="PageLocationCollection"/>.
/// This argument can be a null reference.
/// </param>
/// <returns>The zero-based index of <paramref name="value"/> in the sorted
/// <see cref="PageLocationCollection"/>, if <paramref name="value"/> is found;
/// otherwise, a negative number, which is the bitwise complement of the index
/// of the next element that is larger than <paramref name="value"/> or, if there
/// is no larger element, the bitwise complement of <see cref="Count"/>.</returns>
/// <exception cref="InvalidOperationException">
/// Neither <paramref name="value"/> nor the elements of the <see cref="PageLocationCollection"/>
/// implement the <see cref="IComparable"/> interface.</exception>
/// <remarks>Please refer to <see cref="ArrayList.BinarySearch"/> for details.</remarks>
public virtual int BinarySearch(PageLocation value)
{
return Array.BinarySearch(this._array, 0, this._count, value);
}
#endregion
#region Clear
/// <summary>
/// Removes all elements from the <see cref="PageLocationCollection"/>.
/// </summary>
/// <exception cref="NotSupportedException">
/// <para>The <see cref="PageLocationCollection"/> is read-only.</para>
/// <para>-or-</para>
/// <para>The <b>PageLocationCollection</b> has a fixed size.</para></exception>
/// <remarks>Please refer to <see cref="ArrayList.Clear"/> for details.</remarks>
public virtual void Clear()
{
if (this._count == 0)
return;
++this._version;
Array.Clear(this._array, 0, this._count);
this._count = 0;
}
#endregion
#region Clone
/// <summary>
/// Creates a shallow copy of the <see cref="PageLocationCollection"/>.
/// </summary>
/// <returns>A shallow copy of the <see cref="PageLocationCollection"/>.</returns>
/// <remarks>Please refer to <see cref="ArrayList.Clone"/> for details.</remarks>
public virtual object Clone()
{
PageLocationCollection collection = new PageLocationCollection(this._count);
Array.Copy(this._array, 0, collection._array, 0, this._count);
collection._count = this._count;
collection._version = this._version;
return collection;
}
#endregion
#region Contains
/// <summary>
/// Determines whether the <see cref="PageLocationCollection"/>
/// contains the specified <see cref="PageLocation"/> element.
/// </summary>
/// <param name="value">The <see cref="PageLocation"/> object
/// to locate in the <see cref="PageLocationCollection"/>.
/// This argument can be a null reference.
/// </param>
/// <returns><c>true</c> if <paramref name="value"/> is found in the
/// <see cref="PageLocationCollection"/>; otherwise, <c>false</c>.</returns>
/// <remarks>Please refer to <see cref="ArrayList.Contains"/> for details.</remarks>
public virtual bool Contains(PageLocation value)
{
return (IndexOf(value) >= 0);
}
/// <summary>
/// Determines whether the <see cref="PageLocationCollection"/> contains the specified element.
/// </summary>
/// <param name="value">The object to locate in the <see cref="PageLocationCollection"/>.
/// This argument must be compatible with <see cref="PageLocation"/>.
/// This argument can be a null reference.
/// </param>
/// <returns><c>true</c> if <paramref name="value"/> is found in the
/// <see cref="PageLocationCollection"/>; otherwise, <c>false</c>.</returns>
/// <exception cref="InvalidCastException"><paramref name="value"/>
/// is not compatible with <see cref="PageLocation"/>.</exception>
/// <remarks>Please refer to <see cref="ArrayList.Contains"/> for details.</remarks>
bool IList.Contains(object value)
{
return Contains((PageLocation) value);
}
#endregion
#region CopyTo
/// <overloads>
/// Copies the <see cref="PageLocationCollection"/> or a portion of it to a one-dimensional array.
/// </overloads>
/// <summary>
/// Copies the entire <see cref="PageLocationCollection"/> to a one-dimensional <see cref="Array"/>
/// of <see cref="PageLocation"/> elements, starting at the beginning of the target array.
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the
/// <see cref="PageLocation"/> elements copied from the <see cref="PageLocationCollection"/>.
/// The <b>Array</b> must have zero-based indexing.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="array"/> is a null reference.</exception>
/// <exception cref="ArgumentException">
/// The number of elements in the source <see cref="PageLocationCollection"/> is greater
/// than the available space in the destination <paramref name="array"/>.</exception>
/// <remarks>Please refer to <see cref="ArrayList.CopyTo"/> for details.</remarks>
public virtual void CopyTo(PageLocation[] array)
{
CheckTargetArray(array, 0);
Array.Copy(this._array, array, this._count);
}
/// <summary>
/// Copies the entire <see cref="PageLocationCollection"/> to a one-dimensional <see cref="Array"/>
/// of <see cref="PageLocation"/> elements, starting at the specified index of the target array.
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the
/// <see cref="PageLocation"/> elements copied from the <see cref="PageLocationCollection"/>.
/// The <b>Array</b> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array"/>
/// at which copying begins.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="array"/> is a null reference.</exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="arrayIndex"/> is less than zero.</exception>
/// <exception cref="ArgumentException"><para>
/// <paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.
/// </para><para>-or-</para><para>
/// The number of elements in the source <see cref="PageLocationCollection"/> is greater than the
/// available space from <paramref name="arrayIndex"/> to the end of the destination
/// <paramref name="array"/>.</para></exception>
/// <remarks>Please refer to <see cref="ArrayList.CopyTo"/> for details.</remarks>
public virtual void CopyTo(PageLocation[] array, int arrayIndex)
{
CheckTargetArray(array, arrayIndex);
Array.Copy(this._array, 0, array, arrayIndex, this._count);
}
/// <summary>
/// Copies the entire <see cref="PageLocationCollection"/> to a one-dimensional <see cref="Array"/>,
/// starting at the specified index of the target array.
/// </summary>
/// <param name="array">The one-dimensional <see cref="Array"/> that is the destination of the
/// <see cref="PageLocation"/> elements copied from the <see cref="PageLocationCollection"/>.
/// The <b>Array</b> must have zero-based indexing.</param>
/// <param name="arrayIndex">The zero-based index in <paramref name="array"/>
/// at which copying begins.</param>
/// <exception cref="ArgumentNullException">
/// <paramref name="array"/> is a null reference.</exception>
/// <exception cref="ArgumentOutOfRangeException">
/// <paramref name="arrayIndex"/> is less than zero.</exception>
/// <exception cref="ArgumentException"><para>
/// <paramref name="array"/> is multidimensional.
/// </para><para>-or-</para><para>
/// <paramref name="arrayIndex"/> is equal to or greater than the length of <paramref name="array"/>.
/// </para><para>-or-</para><para>
/// The number of elements in the source <see cref="PageLocationCollection"/> is greater than the
/// available space from <paramref name="arrayIndex"/> to the end of the destination
/// <paramref name="array"/>.</para></exception>
/// <exception cref="InvalidCastException">
/// The <see cref="PageLocation"/> type cannot be cast automatically
/// to the type of the destination <paramref name="array"/>.</exception>
/// <remarks>Please refer to <see cref="ArrayList.CopyTo"/> for details.</remarks>
void ICollection.CopyTo(Array array, int arrayIndex)
{
CheckTargetArray(array, arrayIndex);
CopyTo((PageLocation[]) array, arrayIndex);
}
#endregion
#region GetEnumerator
/// <summary>
/// Returns an <see cref="IPageLocationEnumerator"/> that can
/// iterate through the <see cref="PageLocationCollection"/>.
/// </summary>
/// <returns>An <see cref="IPageLocationEnumerator"/>
/// for the entire <see cref="PageLocationCollection"/>.</returns>
/// <remarks>Please refer to <see cref="ArrayList.GetEnumerator"/> for details.</remarks>
public virtual IPageLocationEnumerator GetEnumerator()
{
return new Enumerator(this);
}
/// <summary>
/// Returns an <see cref="IEnumerator"/> that can
/// iterate through the <see cref="PageLocationCollection"/>.
/// </summary>
/// <returns>An <see cref="IEnumerator"/>
/// for the entire <see cref="PageLocationCollection"/>.</returns>
/// <remarks>Please refer to <see cref="ArrayList.GetEnumerator"/> for details.</remarks>
IEnumerator IEnumerable.GetEnumerator()
{
return (IEnumerator) GetEnumerator();
}
#endregion
#region IndexOf
/// <summary>
/// Returns the zero-based index of the first occurrence of the specified
/// <see cref="PageLocation"/> in the <see cref="PageLocationCollection"/>.
/// </summary>
/// <param name="value">The <see cref="PageLocation"/> object
/// to locate in the <see cref="PageLocationCollection"/>.
/// This argument can be a null reference.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of <paramref name="value"/>
/// in the <see cref="PageLocationCollection"/>, if found; otherwise, -1.
/// </returns>
/// <remarks>Please refer to <see cref="ArrayList.IndexOf"/> for details.</remarks>
public virtual int IndexOf(PageLocation value)
{
return Array.IndexOf(this._array, value, 0, this._count);
}
/// <summary>
/// Returns the zero-based index of the first occurrence of the specified
/// <see cref="Object"/> in the <see cref="PageLocationCollection"/>.
/// </summary>
/// <param name="value">The object to locate in the <see cref="PageLocationCollection"/>.
/// This argument must be compatible with <see cref="PageLocation"/>.
/// This argument can be a null reference.
/// </param>
/// <returns>
/// The zero-based index of the first occurrence of <paramref name="value"/>
/// in the <see cref="PageLocationCollection"/>, if found; otherwise, -1.
/// </returns>
/// <exception cref="InvalidCastException"><paramref name="value"/>
/// is not compatible with <see cref="PageLocation"/>.</exception>
/// <remarks>Please refer to <see cref="ArrayList.IndexOf"/> for details.</remarks>
int IList.IndexOf(object value)
{
return IndexOf((PageLocation) value);
}
#endregion
#region Insert
/// <summary>
/// Inserts a <see cref="PageLocation"/> element into the
/// <see cref="PageLocationCollection"/> at the specified index.
/// </summary>
/// <param name="index">The zero-based index at which <paramref name="value"/>
/// should be inserted.</param>
/// <param name="value">The <see cref="PageLocation"/> object
/// to insert into the <see cref="PageLocationCollection"/>.
/// This argument can be a null reference.
/// </param>
/// <exception cref="ArgumentOutOfRangeException">
/// <para><paramref name="index"/> is less than zero.</para>
/// <para>-or-</para>
/// <para><paramref name="index"/> is greater than <see cref="Count"/>.</para>
/// </exception>
/// <exception cref="NotSupportedException">
/// <para>The <see cref="PageLocationCollection"/> is read-only.</para>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -