共用方式為


IVsTextImage.Replace 方法

通知的文字範圍取代。

命名空間:  Microsoft.VisualStudio.TextManager.Interop
組件:  Microsoft.VisualStudio.TextManager.Interop (在 Microsoft.VisualStudio.TextManager.Interop.dll 中)

語法

'宣告
Function Replace ( _
    dwFlags As UInteger, _
    pts As TextSpan(), _
    cch As Integer, _
    pchText As String, _
    <OutAttribute> ptsChanged As TextSpan() _
) As Integer
int Replace(
    uint dwFlags,
    TextSpan[] pts,
    int cch,
    string pchText,
    TextSpan[] ptsChanged
)
int Replace(
    [InAttribute] unsigned int dwFlags, 
    [InAttribute] array<TextSpan>^ pts, 
    [InAttribute] int cch, 
    [InAttribute] String^ pchText, 
    [OutAttribute] array<TextSpan>^ ptsChanged
)
abstract Replace : 
        dwFlags:uint32 * 
        pts:TextSpan[] * 
        cch:int * 
        pchText:string * 
        ptsChanged:TextSpan[] byref -> int
function Replace(
    dwFlags : uint, 
    pts : TextSpan[], 
    cch : int, 
    pchText : String, 
    ptsChanged : TextSpan[]
) : int

參數

  • dwFlags
    類型:UInt32

    [in]包含旗標的雙字。 供日後使用。 設為零。

  • cch
    類型:Int32

    [in]中的字元計數pchText。

  • pchText
    類型:String

    [in]文字字串的指標。

傳回值

類型:Int32
如果此方法將會成功,則會傳回S_OK。如果失敗,它就會傳回錯誤碼。

備註

環境將會呼叫IVsTextImage.Replace來通知您在文字範圍上進行取代作業。 返回環境中的新的文字範圍。

COM 簽章

從 textmgr.idl:

HRESULT IVsTextImage::Replace(
   [in] DWORD dwFlags,
   [in] const TextSpan * pts,
   [in] LONG cch,
   [in, size_is(cch)] LPCOLESTR pchText,
   [out, retval] TextSpan * ptsChanged
);

.NET Framework 安全性

請參閱

參考

IVsTextImage 介面

Microsoft.VisualStudio.TextManager.Interop 命名空間