ITextStructureNavigatorSelectorService.CreateTextStructureNavigator Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a new ITextStructureNavigator for the specified ITextBuffer by using the specified IContentType to select the navigator.
public:
Microsoft::VisualStudio::Text::Operations::ITextStructureNavigator ^ CreateTextStructureNavigator(Microsoft::VisualStudio::Text::ITextBuffer ^ textBuffer, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
public:
Microsoft::VisualStudio::Text::Operations::ITextStructureNavigator ^ CreateTextStructureNavigator(Microsoft::VisualStudio::Text::ITextBuffer ^ textBuffer, Microsoft::VisualStudio::Utilities::IContentType ^ contentType);
Microsoft::VisualStudio::Text::Operations::ITextStructureNavigator CreateTextStructureNavigator(Microsoft::VisualStudio::Text::ITextBuffer const & textBuffer, Microsoft::VisualStudio::Utilities::IContentType const & contentType);
public Microsoft.VisualStudio.Text.Operations.ITextStructureNavigator CreateTextStructureNavigator (Microsoft.VisualStudio.Text.ITextBuffer textBuffer, Microsoft.VisualStudio.Utilities.IContentType contentType);
abstract member CreateTextStructureNavigator : Microsoft.VisualStudio.Text.ITextBuffer * Microsoft.VisualStudio.Utilities.IContentType -> Microsoft.VisualStudio.Text.Operations.ITextStructureNavigator
Public Function CreateTextStructureNavigator (textBuffer As ITextBuffer, contentType As IContentType) As ITextStructureNavigator
Parameters
- textBuffer
- ITextBuffer
The ITextBuffer that the ITextStructureNavigator will navigate.
- contentType
- IContentType
The content type to use.
Returns
A valid ITextStructureNavigator. This value is never null
).
Exceptions
textBuffer
is null
.
Remarks
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.