TagAggregatorBase<T> Class
An abstract base class for an object that aggregates ITag objects from multiple ITagger<T> instances.
public abstract class TagAggregatorBase<T> : DisposableObjectBase, ITagAggregator<T>, ITagAggregatorBase, IDisposable where T : ITag
- Type Parameters:
-
T-The type of ITag associated with this aggregator.
- Inheritance:
- object DisposableObjectBase object
- Implements:
- ITagAggregator<T> ITagAggregatorBase IDisposable
Constructors
TagAggregatorBase()
Initializes an instance of the class.
protected TagAggregatorBase()
TagAggregatorBase(bool)
An abstract base class for an object that aggregates ITag objects from multiple ITagger<T> instances.
protected TagAggregatorBase(bool canAttachToEvents)
| Parameter | Type | Description |
|---|---|---|
| canAttachToEvents | bool | Whether to attach to events such as document language changes. |
Properties
CanAttachToEvents
Indicates whether the tag aggregator can attach to events.
IsDisposed
Indicates whether this object has been disposed.
protected bool IsDisposed { get; }
Property Value
- bool:
trueif this object has been disposed; otherwise,false.
Methods
AttachDocument(ICodeDocument)
Attaches to a new document.
protected void AttachDocument(ICodeDocument newDocument)
| Parameter | Type | Description |
|---|---|---|
| newDocument | ICodeDocument | The new ICodeDocument. |
DetachDocument()
Detaches the document.
protected void DetachDocument()
Dispose(bool)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
protected override void Dispose(bool disposing)
| Parameter | Type | Description |
|---|---|---|
| disposing | bool |
|
Remarks
This method is called by the public Dispose() method and the Finalize method.
Dispose invokes this method with the disposing parameter set to true.
Finalize invokes this method with disposing set to false.
GetTaggers()
Returns the list of available taggers.
GetTags(NormalizedTextSnapshotRangeCollection, object?)
Returns the tag ranges that intersect with the specified normalized snapshot ranges.
public 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
GetTags(params TextSnapshotRange[])
Returns the tag ranges that intersect with the specified snapshot ranges.
public IEnumerable<TagSnapshotRange<T>> GetTags(params TextSnapshotRange[] snapshotRanges)
| Parameter | Type | Description |
|---|---|---|
| snapshotRanges | TextSnapshotRange[] | The array of snapshot ranges. |
Returns
IsRefreshRequired(object)
Returns whether a Refresh() is required when the specified service is added to or removed from the document's language.
protected virtual bool IsRefreshRequired(object service)
| Parameter | Type | Description |
|---|---|---|
| service | object | The service to examine. |
Returns
- bool:
trueif a refresh is required; otherwise,false.
OnTagsChanged(TagsChangedEventArgs)
Raises the TagsChanged event.
protected virtual void OnTagsChanged(TagsChangedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | TagsChangedEventArgs | The event data. |
Refresh()
Refreshes the tag aggregator by reloading the taggers being watched.
protected void Refresh()
Events
TagsChanged
Occurs after available tags for a specified TextSnapshotRange have changed.
public event EventHandler<TagsChangedEventArgs>? TagsChanged
Event Type
Inherited Members
- DisposableObjectBase.Dispose()
- object.GetType()
- object.MemberwiseClone()
- object.ToString()
- object.Equals(object)
- object.Equals(object, object)
- object.ReferenceEquals(object, object)
- object.GetHashCode()