mscorlib(4.0.0.0) API with additions
|
Delimits a section of a one-dimensional array. More...
Public Member Functions | |
ArraySegment (T[] array) | |
Initializes a new instance of the T:System.ArraySegment`1 structure that delimits all the elements in the specified array. More... | |
ArraySegment (T[] array, int offset, int count) | |
Initializes a new instance of the T:System.ArraySegment`1 structure that delimits the specified range of the elements in the specified array. More... | |
override int | GetHashCode () |
Returns the hash code for the current instance. More... | |
override bool | Equals (object obj) |
Determines whether the specified object is equal to the current instance. More... | |
bool | Equals (ArraySegment< T > obj) |
Determines whether the specified T:System.ArraySegment`1 structure is equal to the current instance. More... | |
int IList< T >. | IndexOf (T item) |
Determines the index of a specific item in the array segment. More... | |
void IList< T >. | Insert (int index, T item) |
Inserts an item into the array segment at the specified index. More... | |
void IList< T >. | RemoveAt (int index) |
Removes the array segment item at the specified index. More... | |
void ICollection< T >. | Add (T item) |
Adds an item to the array segment. More... | |
void ICollection< T >. | Clear () |
Removes all items from the array segment. More... | |
bool ICollection< T >. | Contains (T item) |
Determines whether the array segment contains a specific value. More... | |
void ICollection< T >. | CopyTo (T[] array, int arrayIndex) |
Copies the elements of the array segment to an array, starting at the specified array index. More... | |
bool ICollection< T >. | Remove (T item) |
Removes the first occurrence of a specific object from the array segment. More... | |
IEnumerator< T > IEnumerable< T >. | GetEnumerator () |
Returns an enumerator that iterates through the array segment. More... | |
IEnumerator IEnumerable. | GetEnumerator () |
Returns an enumerator that iterates through an array segment. More... | |
![]() | |
int | Add (object value) |
Adds an item to the T:System.Collections.IList. More... | |
bool | Contains (object value) |
Determines whether the T:System.Collections.IList contains a specific value. More... | |
void | Clear () |
Removes all items from the T:System.Collections.IList. More... | |
int | IndexOf (object value) |
Determines the index of a specific item in the T:System.Collections.IList. More... | |
void | Insert (int index, object value) |
Inserts an item to the T:System.Collections.IList at the specified index. More... | |
void | Remove (object value) |
Removes the first occurrence of a specific object from the T:System.Collections.IList. More... | |
void | RemoveAt (int index) |
Removes the T:System.Collections.IList item at the specified index. More... | |
![]() | |
void | CopyTo (Array array, int index) |
Copies the elements of the T:System.Collections.ICollection to an T:System.Array, starting at a particular T:System.Array index. More... | |
![]() | |
IEnumerator | GetEnumerator () |
Returns an enumerator that iterates through a collection. More... | |
Static Public Member Functions | |
static bool | operator== (ArraySegment< T > a, ArraySegment< T > b) |
Indicates whether two T:System.ArraySegment`1 structures are equal. More... | |
static bool | operator != (ArraySegment< T > a, ArraySegment< T > b) |
Indicates whether two T:System.ArraySegment`1 structures are unequal. More... | |
Properties | |
T [] | Array [get] |
Gets the original array containing the range of elements that the array segment delimits. More... | |
int | Offset [get] |
Gets the position of the first element in the range delimited by the array segment, relative to the start of the original array. More... | |
int | Count [get] |
Gets the number of elements in the range delimited by the array segment. More... | |
T IList< T >. | this[int index] [get, set] |
Gets or sets the element at the specified index. More... | |
T IReadOnlyList< T >. | this[int index] [get] |
Gets the element at the specified index of the array segment. More... | |
bool ICollection< T >. | IsReadOnly [get] |
Gets a value that indicates whether the array segment is read-only. More... | |
![]() | |
object | this[int index] [get, set] |
Gets or sets the element at the specified index. More... | |
bool | IsReadOnly [get] |
Gets a value indicating whether the T:System.Collections.IList is read-only. More... | |
bool | IsFixedSize [get] |
Gets a value indicating whether the T:System.Collections.IList has a fixed size. More... | |
![]() | |
int | Count [get] |
Gets the number of elements contained in the T:System.Collections.ICollection. More... | |
object | SyncRoot [get] |
Gets an object that can be used to synchronize access to the T:System.Collections.ICollection. More... | |
bool | IsSynchronized [get] |
Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (thread safe). More... | |
![]() | |
T | this[int index] [get] |
Gets the element at the specified index in the read-only list. More... | |
![]() | |
int | Count [get] |
Gets the number of elements in the collection. More... | |
Delimits a section of a one-dimensional array.
T | The type of the elements in the array segment. |
Definition at line 10 of file ArraySegment.cs.
System.ArraySegment< T >.ArraySegment | ( | T [] | array | ) |
Initializes a new instance of the T:System.ArraySegment`1 structure that delimits all the elements in the specified array.
array | The array to wrap. |
T:System.ArgumentNullException | array is null . |
Definition at line 196 of file ArraySegment.cs.
System.ArraySegment< T >.ArraySegment | ( | T [] | array, |
int | offset, | ||
int | count | ||
) |
Initializes a new instance of the T:System.ArraySegment`1 structure that delimits the specified range of the elements in the specified array.
array | The array containing the range of elements to delimit. |
offset | The zero-based index of the first element in the range. |
count | The number of elements in the range. |
T:System.ArgumentNullException | array is null . |
T:System.ArgumentOutOfRangeException | offset or count is less than 0. |
T:System.ArgumentException | offset and count do not specify a valid range in array . |
Definition at line 218 of file ArraySegment.cs.
void ICollection<T>. System.ArraySegment< T >.Add | ( | T | item | ) |
Adds an item to the array segment.
item | The object to add to the array segment. |
T:System.NotSupportedException | The array segment is read-only. |
Definition at line 348 of file ArraySegment.cs.
void ICollection<T>. System.ArraySegment< T >.Clear | ( | ) |
Removes all items from the array segment.
T:System.NotSupportedException | The array segment is read-only. |
Definition at line 356 of file ArraySegment.cs.
bool ICollection<T>. System.ArraySegment< T >.Contains | ( | T | item | ) |
Determines whether the array segment contains a specific value.
item | The object to locate in the array segment. |
true
if item is found in the array segment; otherwise, false
.Definition at line 366 of file ArraySegment.cs.
void ICollection<T>. System.ArraySegment< T >.CopyTo | ( | T [] | array, |
int | arrayIndex | ||
) |
Copies the elements of the array segment to an array, starting at the specified array index.
array | The one-dimensional array that is the destination of the elements copied from the array segment. The array must have zero-based indexing. |
arrayIndex | The zero-based index in array at which copying begins. |
T:System.ArgumentNullException | array is null . |
T:System.ArgumentOutOfRangeException | arrayIndex is less than 0. |
T:System.ArgumentException | array is multidimensional.-or-The number of elements in the source array segment is greater than the available space from arrayIndex to the end of the destination array .-or-Type T cannot be cast automatically to the type of the destination array . |
Definition at line 386 of file ArraySegment.cs.
override bool System.ArraySegment< T >.Equals | ( | object | obj | ) |
Determines whether the specified object is equal to the current instance.
obj | The object to be compared with the current instance. |
true
if the specified object is a T:System.ArraySegment`1 structure and is equal to the current instance; otherwise, false
.Definition at line 258 of file ArraySegment.cs.
bool System.ArraySegment< T >.Equals | ( | ArraySegment< T > | obj | ) |
Determines whether the specified T:System.ArraySegment`1 structure is equal to the current instance.
obj | The structure to compare with the current instance. |
true
if the specified T:System.ArraySegment`1 structure is equal to the current instance; otherwise, false
.Definition at line 272 of file ArraySegment.cs.
IEnumerator<T> IEnumerable<T>. System.ArraySegment< T >.GetEnumerator | ( | ) |
Returns an enumerator that iterates through the array segment.
Implements System.Collections.IEnumerable.
Definition at line 409 of file ArraySegment.cs.
IEnumerator IEnumerable. System.ArraySegment< T >.GetEnumerator | ( | ) |
Returns an enumerator that iterates through an array segment.
Implements System.Collections.IEnumerable.
Definition at line 421 of file ArraySegment.cs.
override int System.ArraySegment< T >.GetHashCode | ( | ) |
Returns the hash code for the current instance.
Definition at line 244 of file ArraySegment.cs.
int IList<T>. System.ArraySegment< T >.IndexOf | ( | T | item | ) |
Determines the index of a specific item in the array segment.
item | The object to locate in the array segment. |
Definition at line 307 of file ArraySegment.cs.
void IList<T>. System.ArraySegment< T >.Insert | ( | int | index, |
T | item | ||
) |
Inserts an item into the array segment at the specified index.
index | The zero-based index at which item should be inserted. |
item | The object to insert into the array segment. |
T:System.ArgumentOutOfRangeException | index is not a valid index in the array segment. |
T:System.NotSupportedException | The array segment is read-only. |
Definition at line 328 of file ArraySegment.cs.
|
static |
Indicates whether two T:System.ArraySegment`1 structures are unequal.
a | The structure on the left side of the inequality operator. |
b | The structure on the right side of the inequality operator. |
true
if a is not equal to b ; otherwise, false
.Definition at line 298 of file ArraySegment.cs.
|
static |
Indicates whether two T:System.ArraySegment`1 structures are equal.
a | The structure on the left side of the equality operator. |
b | The structure on the right side of the equality operator. |
true
if a is equal to b ; otherwise, false
.Definition at line 287 of file ArraySegment.cs.
bool ICollection<T>. System.ArraySegment< T >.Remove | ( | T | item | ) |
Removes the first occurrence of a specific object from the array segment.
item | The object to remove from the array segment. |
true
if item was successfully removed from the array segment; otherwise, false
. This method also returns false
if item is not found in the array segment.T:System.NotSupportedException | The array segment is read-only. |
Definition at line 401 of file ArraySegment.cs.
void IList<T>. System.ArraySegment< T >.RemoveAt | ( | int | index | ) |
Removes the array segment item at the specified index.
index | The zero-based index of the item to remove. |
T:System.ArgumentOutOfRangeException | index is not a valid index in the array segment. |
T:System.NotSupportedException | The array segment is read-only. |
Definition at line 339 of file ArraySegment.cs.
|
get |
Gets the original array containing the range of elements that the array segment delimits.
Definition at line 85 of file ArraySegment.cs.
|
get |
Gets the number of elements in the range delimited by the array segment.
Definition at line 109 of file ArraySegment.cs.
|
get |
Gets a value that indicates whether the array segment is read-only.
true
if the array segment is read-only; otherwise, false
.Definition at line 183 of file ArraySegment.cs.
|
get |
Gets the position of the first element in the range delimited by the array segment, relative to the start of the original array.
Definition at line 97 of file ArraySegment.cs.
|
getset |
Gets or sets the element at the specified index.
index | The zero-based index of the element to get or set. |
T:System.ArgumentOutOfRangeException | index is not a valid index in the T:System.ArraySegment`1. |
T:System.NotSupportedException | The property is set and the array segment is read-only. |
Definition at line 125 of file ArraySegment.cs.
|
get |
Gets the element at the specified index of the array segment.
index | The zero-based index of the element to get. |
T:System.ArgumentOutOfRangeException | index is not a valid index in the T:System.ArraySegment`1. |
T:System.NotSupportedException | The property is set. |
Definition at line 162 of file ArraySegment.cs.