Export (0) Print
Expand All

ArraySegment<T> Structure

Delimits a section of a one-dimensional array.

Namespace:  System
Assembly:  mscorlib (in mscorlib.dll)

public struct ArraySegment<T>

Type Parameters

T

The type of the elements in the array segment.

The ArraySegment<T> type exposes the following members.

  NameDescription
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ArraySegment<T>(T[])Initializes a new instance of the ArraySegment<T> structure that delimits all the elements in the specified array.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ArraySegment<T>(T[], Int32, Int32)Initializes a new instance of the ArraySegment<T> structure that delimits the specified range of the elements in the specified array.
Top

  NameDescription
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360ArrayGets the original array containing the range of elements that the array segment delimits.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360CountGets the number of elements in the range delimited by the array segment.
Public propertySupported by Silverlight for Windows PhoneSupported by Xbox 360OffsetGets the position of the first element in the range delimited by the array segment, relative to the start of the original array.
Top

  NameDescription
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360Equals(ArraySegment<T>)Determines whether the specified ArraySegment<T> structure is equal to the current instance.
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360Equals(Object)Determines whether the specified object is equal to the current instance. (Overrides ValueType.Equals(Object).)
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360FinalizeAllows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetHashCodeReturns the hash code for the current instance. (Overrides ValueType.GetHashCode().)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360GetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodSupported by Silverlight for Windows PhoneSupported by Xbox 360MemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodSupported by Silverlight for Windows PhoneSupported by Xbox 360ToStringReturns the fully qualified type name of this instance. (Inherited from ValueType.)
Top

  NameDescription
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360EqualityIndicates whether two ArraySegment<T> structures are equal.
Public operatorStatic memberSupported by Silverlight for Windows PhoneSupported by Xbox 360InequalityIndicates whether two ArraySegment<T> structures are unequal.
Top

ArraySegment<T> is a wrapper around an array that delimits a range of elements in that array. Multiple ArraySegment<T> instances can refer to the same original array and can overlap.

The Array property returns the entire original array, not a copy of the array; therefore, changes made to the array returned by the Array property are made to the original array.

The original array must be one-dimensional and must have zero-based indexing.

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft