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:
- System.Object DisposableObject Object
- Implements:
- ITagAggregator<T> ITagAggregatorBase System.IDisposable
Constructors
TagAggregatorBase()
Initializes a new instance of the TagAggregatorBase
class.
protected TagAggregatorBase()
TagAggregatorBase(Boolean)
Initializes a new instance of the TagAggregatorBase
class.
protected TagAggregatorBase(bool canAttachToEvents)
Parameter | Type | Description |
---|---|---|
canAttachToEvents | System.Boolean | 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
- System.Boolean
IsDisposed
Gets whether this object has been disposed.
protected bool IsDisposed { get; }
Property Value
- System.Boolean:
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(Boolean)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
protected override void Dispose(bool disposing)
Parameter | Type | Description |
---|---|---|
disposing | System.Boolean |
|
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
- System.Collections.Generic.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 | System.Object | An optional parameter that provides contextual information about the tag request. |
Returns
- System.Collections.Generic.IEnumerable<TagSnapshotRange<T>>:
The tag ranges that intersect with the specified normalized snapshot ranges.
GetTags(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
- System.Collections.Generic.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 | System.Object | The service to examine. |
Returns
- System.Boolean:
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 |
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
- System.EventHandler<TagsChangedEventArgs>
Inherited Members
- DisposableObject.Dispose()
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()