ITextEdit.Insert Methode
Definition
Überlädt
Insert(Int32, String) |
Fügt den angegebenen |
Insert(Int32, Char[], Int32, Int32) |
Fügt ein Array von Zeichen an der angegebenen |
Insert(Int32, String)
Fügt den angegebenen text
an der angegebenen position
im Textpuffer ein.Inserts the given text
at the specified position
in the text buffer.
public:
bool Insert(int position, System::String ^ text);
public:
bool Insert(int position, Platform::String ^ text);
bool Insert(int position, std::wstring const & text);
public bool Insert (int position, string text);
abstract member Insert : int * string -> bool
Public Function Insert (position As Integer, text As String) As Boolean
Parameter
- position
- Int32
Die Pufferposition, an der das erste Zeichen des Texts angezeigt werden soll.The buffer position at which the first character of the text will appear.
- text
- String
Der einzufügende Text.The text to be inserted.
Gibt zurück
true
, wenn die Einfügung erfolgreich war, false
, wenn Sie aufgrund eines schreibgeschützten Bereichs fehlgeschlagen ist.true
if the insertion succeeded, false
if it failed due to a read-only region.
Ausnahmen
Die Apply()- oder Cancel()- oder Dispose()-Methode wurde zuvor für dieses Objekt aufgerufen.The Apply() or Cancel() or Dispose() method has previously been called on this object.
position
ist kleiner als null oder größer als die Länge des Puffers.position
is less than zero or greater than the length of the buffer.
text
ist NULL.text
is null.
Hinweise
Das Einfügen einer leeren Zeichenfolge ist zwar erfolgreich, generiert jedoch keine neue Momentaufnahme oder gibt ein- Changed Ereignis aus.Inserting an empty string will succeed but will not generate a new snapshot or raise a Changed event.
Gilt für:
Insert(Int32, Char[], Int32, Int32)
Fügt ein Array von Zeichen an der angegebenen position
in der ein ITextBuffer .Inserts an array of characters at the specified position
in the ITextBuffer.
public:
bool Insert(int position, cli::array <char> ^ characterBuffer, int startIndex, int length);
public:
bool Insert(int position, Platform::Array <char16> ^ characterBuffer, int startIndex, int length);
bool Insert(int position, std::Array <char> const & characterBuffer, int startIndex, int length);
public bool Insert (int position, char[] characterBuffer, int startIndex, int length);
abstract member Insert : int * char[] * int * int -> bool
Public Function Insert (position As Integer, characterBuffer As Char(), startIndex As Integer, length As Integer) As Boolean
Parameter
- position
- Int32
Die Pufferposition, an der das erste Zeichen des Texts angezeigt werden soll.The buffer position at which the first character of the text will appear.
- characterBuffer
- Char[]
Das Zeichenarray, aus dem Zeichen eingefügt werden.The character array from which characters will be inserted.
- startIndex
- Int32
Der Index des ersten einzufügenden Zeichens in characterBuffer
.The index in characterBuffer
of the first character to insert.
- length
- Int32
Die Anzahl der Zeichen, die aus eingefügt werden sollen characterBuffer
.The number of characters to insert from characterBuffer
.
Gibt zurück
true
, wenn die Einfügung erfolgreich war, false
, wenn Sie von einem schreibgeschützten Bereich verhindert wurde.true
if the insertion succeeded, false
if it was prevented by a read-only region.
Ausnahmen
Die Apply()- oder Cancel()- oder Dispose()-Methode wurde zuvor für dieses Objekt aufgerufen.The Apply() or Cancel() or Dispose() method has previously been called on this object.
characterBuffer
ist NULL.characterBuffer
is null.
Hinweise
Das Einfügen von NULL Zeichen ist zwar erfolgreich, generiert jedoch keine neue Momentaufnahme oder gibt ein- Changed Ereignis aus.Inserting zero characters will succeed but will not generate a new snapshot or raise a Changed event.