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 命名空间