ITextEdit::Insert Method (Int32, String^)
Visual Studio 2015
Inserts the given text at the specified positionin the text buffer.
Assembly: Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)
Parameters
- position
-
Type:
System::Int32
The buffer position at which the first character of the text will appear.
- text
-
Type:
System::String^
The text to be inserted.
Return Value
Type: System::Booleantrue if the insertion succeeded, false if it failed due to a read-only region.
| Exception | Condition |
|---|---|
| ArgumentNullException | text is null. |
| InvalidOperationException | |
| ArgumentOutOfRangeException | position is less than zero or greater than the length of the buffer. |
Inserting an empty string will succeed, but will not generate a new snapshot or raise a Changed event.
Show: