TaggerBase<T> Class
Provides an abstract base class for an ITagger<T> implementation.
public abstract class TaggerBase<T> : ITagger<T>, ITaggerBase, IOrderable, IKeyedObject where T : ITag
- Type Parameters:
-
T-The type of tag associated with this tagger.
- Inheritance:
- object object
- Derived:
- CollectionTagger<T> TokenTagger
- Implements:
- ITagger<T> ITaggerBase IOrderable IKeyedObject
Constructors
TaggerBase(string, IEnumerable<Ordering>?, ICodeDocument, bool)
Initializes an instance of the class.
protected TaggerBase(string key, IEnumerable<Ordering>? orderings, ICodeDocument document, bool isForLanguage = true)
| Parameter | Type | Description |
|---|---|---|
| key | string | The string-based key that identifies the object. |
| orderings | IEnumerable<Ordering> | The collection of Ordering objects, used to determine how this object is positioned relative to other objects. |
| document | ICodeDocument | The document to which this manager is attached. |
| isForLanguage | bool | Optionally indicates whether this tagger is for a language.
The default value is |
Properties
Document
The document to which this tagger is attached.
Key
The string-based key that identifies the object.
Orderings
The collection of Ordering objects, used to determine how this object is positioned relative to other objects.
Methods
ChangeDocument(ICodeDocument?)
Changes the document associated with the tagger.
protected void ChangeDocument(ICodeDocument? newDocument)
| Parameter | Type | Description |
|---|---|---|
| newDocument | ICodeDocument | The new ICodeDocument. |
Remarks
This method is used when a view-based tagger needs to update the associated document.
Close()
Closes the tagger and detaches it.
public void Close()
GetTags(NormalizedTextSnapshotRangeCollection, object?)
Returns the tag ranges that intersect with the specified normalized snapshot ranges.
public abstract IEnumerable<TagSnapshotRange<T>> GetTags(NormalizedTextSnapshotRangeCollection snapshotRanges, object? parameter)
| Parameter | Type | Description |
|---|---|---|
| snapshotRanges | NormalizedTextSnapshotRangeCollection | The collection of normalized snapshot ranges. |
| parameter | object | An optional parameter that provides contextual information about the tag request. |
Returns
OnClosed()
Occurs when the tagger is closed.
protected virtual void OnClosed()
Remarks
The default implementation of this method does nothing. Overrides should release any event handlers set up in the tagger's constructor.
OnTagAggregatorAttached(ITagAggregatorBase)
Called when the tagger is attached to an ITagAggregatorBase.
protected virtual void OnTagAggregatorAttached(ITagAggregatorBase tagAggregator)
| Parameter | Type | Description |
|---|---|---|
| tagAggregator | ITagAggregatorBase | The aggregator being attached. |
Remarks
The default implementation of this method does nothing.
See Also
OnTagAggregatorDetached(ITagAggregatorBase)
Called when the tagger is detached from an ITagAggregatorBase.
protected virtual void OnTagAggregatorDetached(ITagAggregatorBase tagAggregator)
| Parameter | Type | Description |
|---|---|---|
| tagAggregator | ITagAggregatorBase | The aggregator being detached. |
Remarks
The default implementation of this method does nothing.
See Also
OnTagsChanged(TagsChangedEventArgs)
Raises the TagsChanged event.
protected virtual void OnTagsChanged(TagsChangedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | TagsChangedEventArgs | The event data. |
Events
Closed
Occurs after the tagger is closed.
TagsChanged
Occurs after available tags for a specified TextSnapshotRange have changed.
public event EventHandler<TagsChangedEventArgs>? TagsChanged
Event Type
Inherited Members
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()