ITextStructureNavigatorSelectorService::GetTextStructureNavigator Method (ITextBuffer^)

 

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)

ITextStructureNavigator^ GetTextStructureNavigator(
	ITextBuffer^ textBuffer
)

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 null.

Exception Condition
ArgumentNullException

textBuffer is null.

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.

Return to top
Show: