ITextEdit.Insert, méthode (Int32, array<Char[], Int32, Int32)
Insère un tableau de personnages à la position spécifiée dans ITextBuffer.
Espace de noms : Microsoft.VisualStudio.Text
Assembly : Microsoft.VisualStudio.Text.Data (dans Microsoft.VisualStudio.Text.Data.dll)
Syntaxe
'Déclaration
Function Insert ( _
position As Integer, _
characterBuffer As Char(), _
startIndex As Integer, _
length As Integer _
) As Boolean
bool Insert(
int position,
char[] characterBuffer,
int startIndex,
int length
)
bool Insert(
int position,
array<wchar_t>^ characterBuffer,
int startIndex,
int length
)
abstract Insert :
position:int *
characterBuffer:char[] *
startIndex:int *
length:int -> bool
function Insert(
position : int,
characterBuffer : char[],
startIndex : int,
length : int
) : boolean
Paramètres
position
Type : Int32Position, dans la mémoire tampon, à laquelle doit apparaître le premier caractère du texte.
characterBuffer
Type : array<Char[]Tableau de caractères à partir duquel les caractères seront insérés.
startIndex
Type : Int32Index de la characterBuffer du premier caractère à insérer.
length
Type : Int32Nombre de caractères à insérer à partir de la characterBuffer.
Valeur de retour
Type : Boolean
true si l'insertion a réussi, false si elle a été empêchée par une zone en lecture seule.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | characterBuffer a la valeur nullune référence null (Nothing en Visual Basic). |
InvalidOperationException | Apply ou Cancel ou la méthode d'Dispose a été auparavant invité cet objet. |
ArgumentOutOfRangeException | position est inférieur à zéro ou plus supérieur à la longueur de la mémoire tampon, ou startIndex est inférieur à zéro, ou length est inférieur à zéro, ou startIndex + length est plus supérieur à la longueur d'characterBuffer. |
Notes
Insérant les personnages zéro est annulée mais ne génèrera pas un nouvel instantané ou ne déclenchera pas un événement d'Changed.
Sécurité .NET Framework
- Confiance totale accordée à l'appelant immédiat. Ce membre ne peut pas être utilisé par du code d'un niveau de confiance partiel. Pour plus d'informations, voir Utilisation de bibliothèques à partir de code d'un niveau de confiance partiel.