ITextStructureNavigatorSelectorService::CreateTextStructureNavigator Method (ITextBuffer^, IContentType^)

 

Creates a new ITextStructureNavigator for the specified ITextBuffer by using the specified IContentType to select the navigator.

Namespace:   Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)

ITextStructureNavigator^ CreateTextStructureNavigator(
	ITextBuffer^ textBuffer,
	IContentType^ contentType
)

Parameters

textBuffer
Type: Microsoft.VisualStudio.Text::ITextBuffer^

The ITextBuffer that the ITextStructureNavigator will navigate.

contentType
Type: Microsoft.VisualStudio.Utilities::IContentType^

The content type to use.

Exception Condition
ArgumentNullException

textBuffer is null.

If a navigator for the given content type cannot be found, this method uses 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.

The navigator that is created is not cached; subsequent calls to this method for the same buffer and content type will return different ITextStructureNavigator objects.

Return to top
Show: