ITextDocumentFactoryService.TryGetTextDocument Method
Retrieve an ITextDocument for the given buffer, if one exists.
Namespace: Microsoft.VisualStudio.Text
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Syntax
'Declaration
Function TryGetTextDocument ( _
textBuffer As ITextBuffer, _
<OutAttribute> ByRef textDocument As ITextDocument _
) As Boolean
bool TryGetTextDocument(
ITextBuffer textBuffer,
out ITextDocument textDocument
)
bool TryGetTextDocument(
ITextBuffer^ textBuffer,
[OutAttribute] ITextDocument^% textDocument
)
abstract TryGetTextDocument :
textBuffer:ITextBuffer *
textDocument:ITextDocument byref -> bool
function TryGetTextDocument(
textBuffer : ITextBuffer,
textDocument : ITextDocument
) : boolean
Parameters
textBuffer
Type: Microsoft.VisualStudio.Text.ITextBufferThe ITextBuffer for which to get a document.
textDocument
Type: Microsoft.VisualStudio.Text.ITextDocument%The ITextDocument for this buffer, if one exists.
Return Value
Type: Boolean
true if a document exists for this buffer, false otherwise.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | textBuffer is nulla null reference (Nothing in Visual Basic). |
.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.