IEditorOperations::InsertTextAsBox Method (String^, VirtualSnapshotPoint, VirtualSnapshotPoint)

 

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)

bool InsertTextAsBox(
	String^ text,
	[OutAttribute] VirtualSnapshotPoint% boxStart,
	[OutAttribute] VirtualSnapshotPoint% boxEnd
)

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.

Exception Condition
ArgumentNullException

text is null.

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.

Return to top
Show: