ITextStructureNavigatorSelectorService.GetTextStructureNavigator Method
Gets a ITextStructureNavigator for the specified ITextBuffer, either by creating a new one or by using a cached value.
Namespace: Microsoft.VisualStudio.Text.Operations
Assembly: Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)
Syntax
'Declaración
Function GetTextStructureNavigator ( _
textBuffer As ITextBuffer _
) As ITextStructureNavigator
ITextStructureNavigator GetTextStructureNavigator(
ITextBuffer textBuffer
)
ITextStructureNavigator^ GetTextStructureNavigator(
ITextBuffer^ textBuffer
)
abstract GetTextStructureNavigator :
textBuffer:ITextBuffer -> ITextStructureNavigator
function GetTextStructureNavigator(
textBuffer : ITextBuffer
) : ITextStructureNavigator
Parameters
- textBuffer
Type: Microsoft.VisualStudio.Text.ITextBuffer
The ITextBuffer that the ITextStructureNavigator will navigate.
Return Value
Type: Microsoft.VisualStudio.Text.Operations.ITextStructureNavigator
A valid ITextStructureNavigator. This value will never be nulla null reference (Nothing in Visual Basic).
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | textBuffer is nulla null reference (Nothing in Visual Basic). |
Remarks
If a navigator for the exact IContentType of the given ITextBuffer cannot be found, this method returns one for the parent IContentType. If there is more than one parent IContentType for which there is a matching ITextStructureNavigator, then this method returns the ITextStructureNavigator of an arbitrary parent.
If a new navigator is created, it is cached together with textBuffer, and its lifetime is the same as that of textBuffer.
.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.