Partager via


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)

Syntax

'Declaration
Public Interface ITagAggregator(Of Out T As ITag) _
    Inherits IDisposable
public interface ITagAggregator<out T> : IDisposable 
where T : ITag
generic<typename T>
where T : ITag 
public interface class ITagAggregator : IDisposable
type ITagAggregator<'T when 'T : ITag> =  
    interface 
        interface IDisposable 
    end
JScript does not support generic types or methods.

Type Parameters

  • outT
    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.

Properties

  Name Description
Public property BufferGraph Gets the buffer graph over which this aggregator operates.

Top

Methods

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

Top

Events

  Name Description
Public event BatchedTagsChanged Occurs on idle after one or more TagsChanged events.
Public event TagsChanged Occurs when tags are added to or removed from providers.

Top

Remarks

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.

See Also

Reference

Microsoft.VisualStudio.Text.Tagging Namespace