Share via


ITagger<T>.GetTags Method

Gets all the tags that intersect the specified spans.

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

Syntax

'Declaration
Function GetTags ( _
    spans As NormalizedSnapshotSpanCollection _
) As IEnumerable(Of ITagSpan(Of T))
IEnumerable<ITagSpan<T>> GetTags(
    NormalizedSnapshotSpanCollection spans
)
IEnumerable<ITagSpan<T>^>^ GetTags(
    NormalizedSnapshotSpanCollection^ spans
)
abstract GetTags : 
        spans:NormalizedSnapshotSpanCollection -> IEnumerable<ITagSpan<'T>> 
function GetTags(
    spans : NormalizedSnapshotSpanCollection
) : IEnumerable<ITagSpan<T>>

Parameters

Return Value

Type: System.Collections.Generic.IEnumerable<ITagSpan<T>>
A TagSpan<T> for each tag.

Remarks

Two spans intersect if they have positions in common, or if the end of one span coincides with the start of the other span, and neither is empty.

Taggers are not required to return their tags in any specific order. The recommended way to implement this method is by using generators (yield return), which allows lazy evaluation of the entire tagging stack.

Examples

For an example of how to implement this method, see Walkthrough: Highlighting Text.

.NET Framework Security

See Also

Reference

ITagger<T> Interface

Microsoft.VisualStudio.Text.Tagging Namespace