Delen via


ITextStructureNavigatorSelectorService.CreateTextStructureNavigator Method

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)

Syntax

'Declaration
Function CreateTextStructureNavigator ( _
    textBuffer As ITextBuffer, _
    contentType As IContentType _
) As ITextStructureNavigator
ITextStructureNavigator CreateTextStructureNavigator(
    ITextBuffer textBuffer,
    IContentType contentType
)
ITextStructureNavigator^ CreateTextStructureNavigator(
    ITextBuffer^ textBuffer, 
    IContentType^ contentType
)
abstract CreateTextStructureNavigator : 
        textBuffer:ITextBuffer * 
        contentType:IContentType -> ITextStructureNavigator
function CreateTextStructureNavigator(
    textBuffer : ITextBuffer, 
    contentType : IContentType
) : ITextStructureNavigator

Parameters

Return Value

Type: Microsoft.VisualStudio.Text.Operations.ITextStructureNavigator
A valid ITextStructureNavigator. This value is never 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 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.

.NET Framework Security

See Also

Reference

ITextStructureNavigatorSelectorService Interface

Microsoft.VisualStudio.Text.Operations Namespace