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

'Declaration
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

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

See Also

Reference

ITextStructureNavigatorSelectorService Interface

Microsoft.VisualStudio.Text.Operations Namespace