In This Article

TagAggregatorBase<T> Class

An abstract base class for an object that aggregates ITag objects from multiple ITagger<T> instances.

public abstract class TagAggregatorBase<T> : DisposableObject, ITagAggregator<T>, ITagAggregatorBase, IDisposable where T : ITag
Type Parameters:
T -

The type of ITag associated with this aggregator.

Inheritance:
object DisposableObject object
Implements:
ITagAggregator<T> ITagAggregatorBase IDisposable

Constructors

TagAggregatorBase()

Initializes a new instance of the TagAggregatorBase class.

protected TagAggregatorBase()

TagAggregatorBase(bool)

Initializes a new instance of the TagAggregatorBase class.

protected TagAggregatorBase(bool canAttachToEvents)
Parameter Type Description
canAttachToEvents bool

Whether to attach to events such as document language changes.

Properties

CanAttachToEvents

Gets whether the tag aggregator can attach to events.

protected bool CanAttachToEvents { get; }

Property Value

bool

IsDisposed

Gets whether this object has been disposed.

protected bool IsDisposed { get; }

Property Value

bool:

true if 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

true to release both managed and unmanaged resources; false to release only unmanaged resources.

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.

protected virtual IList<ITagger<T>> GetTaggers()

Returns

IList<ITagger<T>>:

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

IEnumerable<TagSnapshotRange<T>>:

The tag ranges that intersect with the specified normalized snapshot ranges.

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

IEnumerable<TagSnapshotRange<T>>:

The tag ranges that intersect with the specified snapshot ranges.

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:

true if a refresh is required; otherwise, false.

OnTagsChanged(TagsChangedEventArgs)

Raises the TagsChanged event.

protected virtual void OnTagsChanged(TagsChangedEventArgs e)
Parameter Type Description
e TagsChangedEventArgs

A TagsChangedEventArgs that contains 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

EventHandler<TagsChangedEventArgs>

Inherited Members