ITextEdit::Insert Method (Int32, array<Char>^, Int32, Int32)
Visual Studio 2015
Inserts an array of characters at the specified position in the ITextBuffer.
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.
- characterBuffer
-
Type:
array<System::Char>^
The character array from which characters will be inserted.
- startIndex
-
Type:
System::Int32
The index in characterBuffer of the first character to insert.
- length
-
Type:
System::Int32
The number of characters to insert from characterBuffer.
Return Value
Type: System::Booleantrue if the insertion succeeded, false if it was prevented by a read-only region.
| Exception | Condition |
|---|---|
| ArgumentNullException | characterBuffer is null. |
| InvalidOperationException | |
| ArgumentOutOfRangeException | position is less than zero or greater than the length of the buffer, or startIndex is less than zero, or length is less than zero, or startIndex + length is greater than the length of characterBuffer. |
Inserting zero characters will succeed but will not generate a new snapshot or raise a Changed event.
Show: