ITextStructureNavigatorSelectorService.CreateTextStructureNavigator(ITextBuffer, IContentType) Метод

Определение

Создает новый объект ITextStructureNavigator для указанного буфера ITextBuffer, используя указанный объект IContentType для выбора навигатора.

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

Параметры

textBuffer
ITextBuffer

Объект ITextBuffer, для перехода по которому будет использоваться ITextStructureNavigator.

contentType
IContentType

Тип контента, который будет использоваться.

Возвращаемое значение

ITextStructureNavigator

Допустимый класс ITextStructureNavigator. Это значение никогда не равно null).

Исключения

Параметр textBuffer имеет значение NULL.

Комментарии

Если навигатор для данного типа содержимого не удается найти, этот метод использует один для родителя IContentType . Если имеется несколько родительских IContentType элементов, для которых существует сопоставление ITextStructureNavigator , этот метод возвращает объект ITextStructureNavigator произвольного родителя.

Созданный навигатор не кэшируется; последующие вызовы этого метода для одного и того же буфера и типа содержимого будут возвращать разные ITextStructureNavigator объекты.

Применяется к