IVsTextLayer.ReplaceLines 方法

处理分行符/连接等。

命名空间:  Microsoft.VisualStudio.TextManager.Interop
程序集:  Microsoft.VisualStudio.TextManager.Interop(在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

语法

声明
Function ReplaceLines ( _
    iStartLine As Integer, _
    iStartIndex As Integer, _
    iEndLine As Integer, _
    iEndIndex As Integer, _
    pszText As IntPtr, _
    iNewLen As Integer, _
    <OutAttribute> pChangedSpan As TextSpan() _
) As Integer
int ReplaceLines(
    int iStartLine,
    int iStartIndex,
    int iEndLine,
    int iEndIndex,
    IntPtr pszText,
    int iNewLen,
    TextSpan[] pChangedSpan
)
int ReplaceLines(
    [InAttribute] int iStartLine, 
    [InAttribute] int iStartIndex, 
    [InAttribute] int iEndLine, 
    [InAttribute] int iEndIndex, 
    [InAttribute] IntPtr pszText, 
    [InAttribute] int iNewLen, 
    [OutAttribute] array<TextSpan>^ pChangedSpan
)
abstract ReplaceLines : 
        iStartLine:int * 
        iStartIndex:int * 
        iEndLine:int * 
        iEndIndex:int * 
        pszText:IntPtr * 
        iNewLen:int * 
        pChangedSpan:TextSpan[] byref -> int
function ReplaceLines(
    iStartLine : int, 
    iStartIndex : int, 
    iEndLine : int, 
    iEndIndex : int, 
    pszText : IntPtr, 
    iNewLen : int, 
    pChangedSpan : TextSpan[]
) : int

参数

  • iStartLine
    类型:Int32

    [in] 启动行。

  • iStartIndex
    类型:Int32

    [in] 在行内开始字符索引 (必须是行的 AMP_LT= 长度)。

  • iEndLine
    类型:Int32

    [in] 结束行。

  • iEndIndex
    类型:Int32

    [in] 在行内结束字符索引 (必须是行的 AMP_LT= 长度)。

  • pszText
    类型:IntPtr

    [in] 要插入的文本,因此,如果有的话)。

  • iNewLen
    类型:Int32

    [in] 字符数要插入的,因此,如果有的话)。

返回值

类型:Int32
如果方法成功,则返回 S_OK。如果失败,它会返回一个错误代码。

备注

COM 签名

从 textmgr.idl:

HRESULT IVsTextLayer::ReplaceLines(
   [in] long iStartLine,
   [in] CharIndex iStartIndex,
   [in] long iEndLine,
   [in] CharIndex iEndIndex,
   [in] LPCWSTR pszText,
   [in] long iNewLen,
   [out] TextSpan * pChangedSpan
);

.NET Framework 安全性

请参阅

参考

IVsTextLayer 接口

Microsoft.VisualStudio.TextManager.Interop 命名空间