Condividi tramite


ITextSnapshot.CopyTo Method

Copies a range of text to a character array.

Namespace:  Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

Syntax

'Dichiarazione
Sub CopyTo ( _
    sourceIndex As Integer, _
    destination As Char(), _
    destinationIndex As Integer, _
    count As Integer _
)
void CopyTo(
    int sourceIndex,
    char[] destination,
    int destinationIndex,
    int count
)
void CopyTo(
    int sourceIndex, 
    array<wchar_t>^ destination, 
    int destinationIndex, 
    int count
)
abstract CopyTo : 
        sourceIndex:int * 
        destination:char[] * 
        destinationIndex:int * 
        count:int -> unit 
function CopyTo(
    sourceIndex : int, 
    destination : char[], 
    destinationIndex : int, 
    count : int
)

Parameters

  • sourceIndex
    Type: System.Int32
    The starting index in the text snapshot.
  • destination
    Type: array<System.Char[]
    The destination array.
  • destinationIndex
    Type: System.Int32
    The index in the destination array at which to start copying the text.
  • count
    Type: System.Int32
    The number of characters to copy.

Exceptions

Exception Condition
ArgumentNullException

destination is nulla null reference (Nothing in Visual Basic).

ArgumentOutOfRangeException

sourceIndex is less than zero or greater than the length of the snapshot, or count is less than zero, or sourceIndex plus count is greater than the length of the snapshot, or destinationIndex is less than zero, or destinationIndex plus count is greater than the length of destination.

.NET Framework Security

See Also

Reference

ITextSnapshot Interface

Microsoft.VisualStudio.Text Namespace