IVsTextManager.RegisterBuffer Method
Registers a text buffer with the text manager.
Namespace: Microsoft.VisualStudio.TextManager.Interop
Assembly: Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)
Syntax
声明
Function RegisterBuffer ( _
pBuffer As IVsTextBuffer _
) As Integer
用法
Dim instance As IVsTextManager
Dim pBuffer As IVsTextBuffer
Dim returnValue As Integer
returnValue = instance.RegisterBuffer(pBuffer)
int RegisterBuffer(
IVsTextBuffer pBuffer
)
int RegisterBuffer(
[InAttribute] IVsTextBuffer^ pBuffer
)
abstract RegisterBuffer :
pBuffer:IVsTextBuffer -> int
function RegisterBuffer(
pBuffer : IVsTextBuffer
) : int
Parameters
- pBuffer
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextBuffer
[in] Pointer to the IVsTextBuffer interface to register.
Return Value
Type: System.Int32
If the method succeeds, it returns S_OK. If it fails, it returns an error code.
Remarks
COM Signature
From textmgr.idl:
HRESULT IVsTextManager::RegisterBuffer(
[in] IVsTextBuffer *pBuffer
);
Use this method to register a text buffer that is created externally. All buffers must register with the text manager service to receive messages, such as change notifications.
备注
To avoid circular reference problems, UnregisterBuffer should be called from the buffer's implementation of the interface Close, which is called from the running document table.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.