共用方式為


ITextSnapshot.CopyTo 方法

將某個範圍內的文字複製到字元陣列。

命名空間:  Microsoft.VisualStudio.Text
組件:  Microsoft.VisualStudio.Text.Data (在 Microsoft.VisualStudio.Text.Data.dll 中)

語法

'宣告
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
)

參數

  • sourceIndex
    類型:Int32

    文字快照中的起始索引。

  • destination
    類型:array<Char[]

    目的陣列。

  • destinationIndex
    類型:Int32

    要開始複製文字之目的陣列中的索引。

  • count
    類型:Int32

    要複製的字元數。

例外狀況

例外狀況 條件
ArgumentNullException

destination 為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

ArgumentOutOfRangeException

sourceIndex小於零或大於長度的快照集,或count小於零,或sourceIndex加上count大於快照、 長度或destinationIndex小於零,或destinationIndex加上count的長度大於destination。

.NET Framework 安全性

請參閱

參考

ITextSnapshot 介面

Microsoft.VisualStudio.Text 命名空間