Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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)

bool TryGetTextDocument(
	ITextBuffer textBuffer,
	out ITextDocument textDocument
)

Parameters

textBuffer
Type: Microsoft.VisualStudio.Text.ITextBuffer

The ITextBuffer for which to get a document.

textDocument
Type: Microsoft.VisualStudio.Text.ITextDocument

The ITextDocument for this buffer, if one exists.

Return Value

Type: System.Boolean
true if a document exists for this buffer, false otherwise.

ExceptionCondition
ArgumentNullException

textBuffer is null.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft