In This Article

ITextRangeIndicatorManager<TTagger, TTag> Interface

Provides the base requirements for a class containing helper methods related to working with an IEditorDocument's text range-based indicators.

public interface ITextRangeIndicatorManager<TTagger, TTag> where TTagger : class, ICollectionTagger<TTag> where TTag : IIndicatorTag, new()
Type Parameters:
TTagger -
TTag -

Properties

Count

Gets the number of indicators.

int Count { get; }

Property Value

int:

The number of indicators.

this[TTag]

Gets the tag range that points to the specified indicator tag.

[C#] In C#, this property is the indexer for the type.

TagVersionRange<TTag> this[TTag tag] { get; }
Parameter Type Description
tag TTag

The indicator tag for which to search.

Property Value

TagVersionRange<TTag>:

The indicator tag range that points to the specified tag.

Methods

Add(TextSnapshotRange)

Adds a new default indicator that is applied to a snapshot text range.

TagVersionRange<TTag> Add(TextSnapshotRange snapshotRange)
Parameter Type Description
snapshotRange TextSnapshotRange

The target TextSnapshotRange.

Returns

TagVersionRange<TTag>:

The TagVersionRange<T> that was created.

Add(TextSnapshotRange, TTag)

Adds a new indicator that is applied to a snapshot text range.

TagVersionRange<TTag> Add(TextSnapshotRange snapshotRange, TTag tag)
Parameter Type Description
snapshotRange TextSnapshotRange

The target TextSnapshotRange.

tag TTag

The IIndicatorTag to add.

Returns

TagVersionRange<TTag>:

The TagVersionRange<T> that was created.

Clear()

Removes all indicators.

void Clear()

FindNext(TextSnapshotOffset, ITagSearchOptions<TTag>)

Finds the next text range-based indicator, using the specified search options.

TagVersionRange<TTag> FindNext(TextSnapshotOffset snapshotOffset, ITagSearchOptions<TTag> options)
Parameter Type Description
snapshotOffset TextSnapshotOffset

The TextSnapshotOffset from which to start the search.

options ITagSearchOptions<TTag>

The optional ITagSearchOptions<T> that specifies search options.

Returns

TagVersionRange<TTag>:

The TagVersionRange<T> that was found, if any.

GetInstances()

Returns all indicator tag ranges.

IEnumerable<TagVersionRange<TTag>> GetInstances()

Returns

IEnumerable<TagVersionRange<TTag>>:

The collection of indicator tag ranges.

GetInstances(TextSnapshotRange)

Returns all indicator tag ranges that occur within the specified TextSnapshotRange.

IEnumerable<TagVersionRange<TTag>> GetInstances(TextSnapshotRange snapshotRange)
Parameter Type Description
snapshotRange TextSnapshotRange

The target TextSnapshotRange.

Returns

IEnumerable<TagVersionRange<TTag>>:

The collection of indicator tag ranges.

Remove(TTag)

Removes a specific indicator.

bool Remove(TTag tag)
Parameter Type Description
tag TTag

The IIndicatorTag to remove.

Returns

bool:

true if the tag was removed; otherwise, false.

RemoveAll(Predicate<TagVersionRange<TTag>>)

Removes all indicator tag ranges that match the conditions defined by the specified predicate.

int RemoveAll(Predicate<TagVersionRange<TTag>> match)
Parameter Type Description
match Predicate<TagVersionRange<TTag>>

The predicate that defines the conditions for removal.

Returns

int:

The number of indicator tag ranges that were removed.

Toggle(TextSnapshotRange)

Toggles whether an indicator is associated with a snapshot text range.

TagVersionRange<TTag> Toggle(TextSnapshotRange snapshotRange)
Parameter Type Description
snapshotRange TextSnapshotRange

The target TextSnapshotRange.

Returns

TagVersionRange<TTag>:

The TagVersionRange<T> that was created, if an indicator was added.

Toggle(TextSnapshotRange, TTag)

Toggles whether an indicator is associated with a snapshot text range.

TagVersionRange<TTag> Toggle(TextSnapshotRange snapshotRange, TTag tag)
Parameter Type Description
snapshotRange TextSnapshotRange

The target TextSnapshotRange.

tag TTag

The IIndicatorTag to add, if no indicator is already on the line.

Returns

TagVersionRange<TTag>:

The TagVersionRange<T> that was created, if an indicator was added.