Partager via


IEditorOperations.InsertTextAsBox Method

Definition

Inserts the given text at the current caret position as a box.

public:
 bool InsertTextAsBox(System::String ^ text, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Text::VirtualSnapshotPoint % boxStart, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Text::VirtualSnapshotPoint % boxEnd);
public bool InsertTextAsBox (string text, out Microsoft.VisualStudio.Text.VirtualSnapshotPoint boxStart, out Microsoft.VisualStudio.Text.VirtualSnapshotPoint boxEnd);
abstract member InsertTextAsBox : string * VirtualSnapshotPoint * VirtualSnapshotPoint -> bool
Public Function InsertTextAsBox (text As String, ByRef boxStart As VirtualSnapshotPoint, ByRef boxEnd As VirtualSnapshotPoint) As Boolean

Parameters

text
String

The text to be inserted in the buffer. Each "line" from the text will be written out a line at a time.

boxStart
VirtualSnapshotPoint

The start of the newly inserted box.

boxEnd
VirtualSnapshotPoint

The end of the newly inserted box.

Returns

true if the edit succeeded, otherwise false.

Exceptions

text is null.

Remarks

This has the same behavior as copying and pasting a box selection. In order to insert the text as a box, the 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 (and starting at the caret's x coordinate on each line).

Applies to