IEditorOperations.InsertTextAsBox Method
Inserts the specified text at the current caret position as a box.
Namespace: Microsoft.VisualStudio.Text.Operations
Assembly: Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)
Syntax
'宣告
Function InsertTextAsBox ( _
text As String, _
<OutAttribute> ByRef boxStart As VirtualSnapshotPoint, _
<OutAttribute> ByRef boxEnd As VirtualSnapshotPoint _
) As Boolean
bool InsertTextAsBox(
string text,
out VirtualSnapshotPoint boxStart,
out VirtualSnapshotPoint boxEnd
)
bool InsertTextAsBox(
String^ text,
[OutAttribute] VirtualSnapshotPoint% boxStart,
[OutAttribute] VirtualSnapshotPoint% boxEnd
)
abstract InsertTextAsBox :
text:string *
boxStart:VirtualSnapshotPoint byref *
boxEnd:VirtualSnapshotPoint byref -> bool
function InsertTextAsBox(
text : String,
boxStart : VirtualSnapshotPoint,
boxEnd : VirtualSnapshotPoint
) : boolean
Parameters
- text
Type: System.String
The text to be inserted in the buffer. Each "line" from the text will be written out a line at a time.
- boxStart
Type: Microsoft.VisualStudio.Text.VirtualSnapshotPoint%
The start of the newly inserted box.
- boxEnd
Type: Microsoft.VisualStudio.Text.VirtualSnapshotPoint%
The end of the newly inserted box.
Return Value
Type: System.Boolean
true if the edit succeeded, otherwise false.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | text is nulla null reference (Nothing in Visual Basic). |
Remarks
This method has the same behavior as copying and pasting a box selection. In order to insert the text as a box, text is split by newlines and inserted a line at a time, each one on a successive line below the line the caret is on, starting at the caret's x coordinate on each line.
.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.