SimpleTagger<T>.CreateTagSpan Method
Adds a tag over the given span.
Namespace: Microsoft.VisualStudio.Text.Tagging
Assembly: Microsoft.VisualStudio.Text.Logic (in Microsoft.VisualStudio.Text.Logic.dll)
Syntax
声明
Public Function CreateTagSpan ( _
span As ITrackingSpan, _
tag As T _
) As TrackingTagSpan(Of T)
public TrackingTagSpan<T> CreateTagSpan(
ITrackingSpan span,
T tag
)
public:
TrackingTagSpan<T>^ CreateTagSpan(
ITrackingSpan^ span,
T tag
)
member CreateTagSpan :
span:ITrackingSpan *
tag:'T -> TrackingTagSpan<'T>
public function CreateTagSpan(
span : ITrackingSpan,
tag : T
) : TrackingTagSpan<T>
Parameters
- span
Type: Microsoft.VisualStudio.Text.ITrackingSpan
The ITrackingSpan that tracks the tag across text versions.
- tag
Type: T
The tag to associate with the given span.
Return Value
Type: Microsoft.VisualStudio.Text.Tagging.TrackingTagSpan<T>
The TrackingTagSpan<T> that was added, which can be used to remove the tag later on.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | span or tag is nulla null reference (Nothing in Visual Basic). |
Remarks
This method is safe to use from any thread.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.