Udostępnij za pośrednictwem


ITaggerProvider Interface

Definition

Creates an ITagger<T> for a given buffer.

public interface class ITaggerProvider
public interface class ITaggerProvider
__interface ITaggerProvider
public interface ITaggerProvider
type ITaggerProvider = interface
Public Interface ITaggerProvider

Remarks

This is a MEF component part, and implementers must use the following attributes:

[Export(typeof(ITaggerProvider))]
[ContentType(...)]                  //Required, must have at least one <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Utilities.ContentTypeAttribute"></xref> (and can have multiple ContentType attributes)
                                    //  Specifies the <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Utilities.IContentType"></xref>s which this provider provides taggers.
[TagType(...))]                     //Required, must have at least one <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Text.Tagging.TagTypeAttribute"></xref> (and can have multiple TagType attributes)
                                    //  Specifies the types of taggers that can be created by this provider.
[Name(...)]                         //Optional, can have only one <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Utilities.NameAttribute"></xref>
                                    //  Specifies the name of the tagger provider.
                                    //  Providers with a name attribute can be replaced by another tagger provider that specifies
                                    //  the name in their <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Text.Editor.ReplacesAttribute"></xref>.
                                    //  In addition, providers with the same name as an IViewTaggerProvider (defined is Microsoft.VisualStudio.Text.UI)
                                    //  will be suppressed if the view tagger provider created a tagger.
[Replaces(...)]                     //Optional, can have zero or more <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Text.Editor.ReplacesAttribute"></xref>
                                    //  Providers with a name attribute that matches replaces attribute of another provider will
                                    //  be suppressed. Note that the other tagger is suppressed even if the replacing provider does not
                                    //  supply a tagger.
[DeferCreation(OptionName = ...)]   //Optional, can have only one <xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Text.Editor.DeferCreationAttribute"></xref>
                                    //  If specified, the tagger will not be created until the option (<xref data-throw-if-not-resolved="true" uid="Microsoft.VisualStudio.Text.Editor.IEditorOptions"></xref>) specified
                                    //  in the defer creation attribute becomes true.

Methods

CreateTagger<T>(ITextBuffer)

Creates a tag provider for the specified buffer.

Applies to