SimpleTagger<T>.CreateTagSpan(ITrackingSpan, T) Method

Definition

Adds a tag over the given span.

public:
 Microsoft::VisualStudio::Text::Tagging::TrackingTagSpan<T> ^ CreateTagSpan(Microsoft::VisualStudio::Text::ITrackingSpan ^ span, T tag);
public Microsoft.VisualStudio.Text.Tagging.TrackingTagSpan<T> CreateTagSpan (Microsoft.VisualStudio.Text.ITrackingSpan span, T tag);
member this.CreateTagSpan : Microsoft.VisualStudio.Text.ITrackingSpan * 'T -> Microsoft.VisualStudio.Text.Tagging.TrackingTagSpan<'T (requires 'T :> Microsoft.VisualStudio.Text.Tagging.ITag)>
Public Function CreateTagSpan (span As ITrackingSpan, tag As T) As TrackingTagSpan(Of T)

Parameters

span
ITrackingSpan

The ITrackingSpan that tracks the tag across text versions.

tag
T

The tag to associate with the given span.

Returns

The TrackingTagSpan<T> that was added, which can be used to remove the tag later on.

Exceptions

span or tag is null.

Remarks

This method is safe to use from any thread.

Applies to