ITagAggregator(T) Interface

ITagAggregator<T> Interface

Aggregates all the tag providers in a buffer graph for the specified type of tag.

Namespace:  Microsoft.VisualStudio.Text.Tagging
Assembly:  Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)

public interface ITagAggregator<out T> : IDisposable
where T : ITag

Type Parameters

out T

The type of tag returned by the aggregator.

This type parameter is covariant. That is, you can use either the type you specified or any type that is more derived. For more information about covariance and contravariance, see Covariance and Contravariance in Generics.

The ITagAggregator<T> type exposes the following members.

Public propertyBufferGraphGets the buffer graph over which this aggregator operates.

Public methodDisposePerforms application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. (Inherited from IDisposable.)
Public methodGetTags(IMappingSpan)Gets all the tags that overlap or are contained by the specified span of the type of the aggregator.
Public methodGetTags(NormalizedSnapshotSpanCollection)Gets all the tags that overlap or are contained by the specified snapshotSpans of the type of the aggregator.
Public methodGetTags(SnapshotSpan)Gets all the tags that overlap or are contained by the specified span of the same type as the aggregator.

Public eventBatchedTagsChangedOccurs on idle after one or more TagsChanged events.
Public eventTagsChangedOccurs when tags are added to or removed from providers.

The default tag aggregator implementation also disposes disposable taggers:

for each ITagger<T> over which the default tag aggregator aggregates tags, if the tagger implements IDisposable, call Dispose() on it when the aggregator is disposed or when the taggers are dropped. For example, you should call Dispose() when the content type of a text buffer changes or when a buffer is removed from the buffer graph.

For more information about tagging, see the "Tags and Classifiers" section of Inside the Editor. For information about extending and adding tags, see the "Extending Tags" section of Editor Extension Points.

Community Additions

© 2016 Microsoft