Copies the collection to the specified array of snapshot spans at the specified location.
Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
声明
Public Sub CopyTo ( _
    array As SnapshotSpan(), _
    arrayIndex As Integer _
)
public void CopyTo(
    SnapshotSpan[] array,
    int arrayIndex
)
public:
virtual void CopyTo(
    array<SnapshotSpan>^ array, 
    int arrayIndex
) sealed
abstract CopyTo : 
        array:SnapshotSpan[] * 
        arrayIndex:int -> unit 
override CopyTo : 
        array:SnapshotSpan[] * 
        arrayIndex:int -> unit 
public final function CopyTo(
    array : SnapshotSpan[], 
    arrayIndex : int
)
Parameters
- array
Type: array<Microsoft.VisualStudio.Text.SnapshotSpan[]
The array of snapshot spans. 
- arrayIndex
Type: System.Int32
The location to which to start copying the snapshot spans. 
Implements
ICollection<T>.CopyTo(array<T[], Int32)
Exceptions
| Exception | Condition | 
|---|---|
| ArgumentNullException | array is nulla null reference (Nothing in Visual Basic).  | 
| ArgumentOutOfRangeException | arrayIndex is negative or greater than the array length, or the number of spans in the collection is greater than the length of the array minus the array index.  | 
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.