ITextEdit.Insert Méthode

Définition

Surcharges

Insert(Int32, String)

Insère le text donné à la position spécifiée de la mémoire tampon de texte.

Insert(Int32, Char[], Int32, Int32)

Insère un tableau de caractères au niveau de l’spécifié position dans le ITextBuffer .

Insert(Int32, String)

Insère le text donné à la position spécifiée de la mémoire tampon de texte.

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

Paramètres

position
Int32

Position, dans la mémoire tampon, à laquelle doit apparaître le premier caractère du texte.

text
String

Texte à insérer.

Retours

Boolean

true si l’insertion a réussi, false si elle a échoué en raison d’une zone en lecture seule.

Exceptions

Apply() ou Cancel() ou la méthode Dispose() a été précédemment appelée sur cet objet.

position est inférieur à zéro ou supérieur à la longueur de la mémoire tampon.

text a la valeur null.

Remarques

L’insertion d’une chaîne vide échoue, mais ne génère pas de nouvel instantané ou déclenche un Changed événement.

S’applique à

Insert(Int32, Char[], Int32, Int32)

Insère un tableau de caractères au niveau de l’spécifié position dans le 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

Paramètres

position
Int32

Position, dans la mémoire tampon, à laquelle doit apparaître le premier caractère du texte.

characterBuffer
Char[]

Tableau de caractères à partir duquel les caractères seront insérés.

startIndex
Int32

Index de la characterBuffer du premier caractère à insérer.

length
Int32

Nombre de caractères à insérer à partir de characterBuffer .

Retours

Boolean

true si l’insertion a réussi, false si elle a été empêchée par une zone en lecture seule.

Exceptions

Apply() ou Cancel() ou la méthode Dispose() a été précédemment appelée sur cet objet.

characterBuffer a la valeur null.

Remarques

L’insertion de zéro caractère échoue, mais ne génère pas de nouvel instantané ou ne déclenche pas d' Changed événement.

S’applique à