共用方式為


IVsTextImage.Replace Method

Notification of a text span replacement.

Namespace:  Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

Syntax

'宣告
Function Replace ( _
    dwFlags As UInteger, _
    pts As TextSpan(), _
    cch As Integer, _
    pchText As String, _
    <OutAttribute> ptsChanged As TextSpan() _
) As Integer
'用途
Dim instance As IVsTextImage
Dim dwFlags As UInteger
Dim pts As TextSpan()
Dim cch As Integer
Dim pchText As String
Dim ptsChanged As TextSpan()
Dim returnValue As Integer

returnValue = instance.Replace(dwFlags, _
    pts, cch, pchText, ptsChanged)
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

Parameters

  • dwFlags
    Type: System.UInt32
    [in] Double word containing flags. For future use. Set to zero.
  • cch
    Type: System.Int32
    [in] Count of characters in pchText.

Return Value

Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

The environment will call IVsTextImage.Replace to notify you of a replace operation done on a text span. Return the new text span to the environment.

COM Signature

From 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 Security

See Also

Reference

IVsTextImage Interface

IVsTextImage Members

Microsoft.VisualStudio.TextManager.Interop Namespace