IAdornmentLayer.AddAdornment Method (SnapshotSpan, Object, UIElement)
Adds a UIElement that is TextRelative to the layer.
Namespace: Microsoft.VisualStudio.Text.Editor
Assembly: Microsoft.VisualStudio.Text.UI.Wpf (in Microsoft.VisualStudio.Text.UI.Wpf.dll)
Syntax
'Declaration
Function AddAdornment ( _
visualSpan As SnapshotSpan, _
tag As Object, _
adornment As UIElement _
) As Boolean
bool AddAdornment(
SnapshotSpan visualSpan,
Object tag,
UIElement adornment
)
bool AddAdornment(
SnapshotSpan visualSpan,
Object^ tag,
UIElement^ adornment
)
abstract AddAdornment :
visualSpan:SnapshotSpan *
tag:Object *
adornment:UIElement -> bool
function AddAdornment(
visualSpan : SnapshotSpan,
tag : Object,
adornment : UIElement
) : boolean
Parameters
visualSpan
Type: Microsoft.VisualStudio.Text.SnapshotSpanThe span with which adornment is associated.
tag
Type: ObjectThe tag associated with adornment.
adornment
Type: UIElementThe UIElement to add to the view.
Return Value
Type: Boolean
true if adornment was added to the layer, otherwise false. visualSpan does not intersect the text that is visible in the view.
Remarks
The adornment is removed when any line that crosses visualSpan is formatted. If visualSpan has a length of zero, then it will be invalidated when the line that contains the following character is invalidated (or the last line, if visualSpan is at the end of the buffer).
.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.