UnicodeCharacterRangeCollection.CopyTo, méthode
Mise à jour : November 2007
Copie tous les éléments de la collection UnicodeCharacterRangeCollection active dans un tableau unidimensionnel spécifié, en commençant à l'index de tableau de destination spécifié.
Espace de noms : Microsoft.Ink
Assembly : Microsoft.Ink.Analysis (dans Microsoft.Ink.Analysis.dll)
Syntaxe
'Déclaration
Public Sub CopyTo ( _
array As UnicodeCharacterRange(), _
index As Integer _
)
'Utilisation
Dim instance As UnicodeCharacterRangeCollection
Dim array As UnicodeCharacterRange()
Dim index As Integer
instance.CopyTo(array, index)
public void CopyTo(
UnicodeCharacterRange[] array,
int index
)
public:
void CopyTo(
array<UnicodeCharacterRange^>^ array,
int index
)
public void CopyTo(
UnicodeCharacterRange[] array,
int index
)
public function CopyTo(
array : UnicodeCharacterRange[],
index : int
)
Paramètres
- array
Type : array<Microsoft.Ink.UnicodeCharacterRange[]
Tableau unidimensionnel qui constitue la destination des éléments copiés à partir de la collection. L'indexation de ce tableau doit être de base zéro.
- index
Type : System.Int32
Index de base zéro dans le paramètre array à partir duquel la copie commence.
Exemples
Dans cet exemple, un UnicodeCharacterRangeCollection est instancié et plusieurs opérations y sont exécutées.
Dim UCRC As UnicodeCharacterRangeCollection = New UnicodeCharacterRangeCollection()
' add three UnicodeCharacterRange objects
UCRC.Add("A", 26)
UCRC.Add("a", 26)
UCRC.Add("0", 10)
Dim countOfRanges As Integer = UCRC.Count ' 3
' this is true because collection contains the exact range
Dim thisIsTrue As Boolean = UCRC.Contains(New UnicodeCharacterRange("A", 26))
' this is false because collection does not contain exact range
Dim thisIsFalse As Boolean = UCRC.Contains(New UnicodeCharacterRange("a", 25))
' does not remove because the exact range: '0', 11 does not exist
UCRC.Remove(New UnicodeCharacterRange("0", 11))
' removes because the exact range '0', 10 does exist
UCRC.Remove(New UnicodeCharacterRange("0", 10))
Dim newCountOfRanges As Integer = UCRC.Count ' 2
' idxOfLowerCase = 1 (2nd range added)
Dim idxOfLowerCase As Integer = UCRC.IndexOf(New UnicodeCharacterRange("a", 26))
' idxOfDigits = -1 because that range does not exist (it was removed)
Dim idxOfDigits As Integer = UCRC.IndexOf(New UnicodeCharacterRange("0", 10))
' create an array of UnicodeCharacterRange
Dim UCRArray(UCRC.Count) As UnicodeCharacterRange
' copy from the collection to the array
UCRC.CopyTo(UCRArray, 0)
UnicodeCharacterRangeCollection UCRC = new UnicodeCharacterRangeCollection();
// add three UnicodeCharacterRange objects
UCRC.Add('A', 26);
UCRC.Add('a', 26);
UCRC.Add('0', 10);
int countOfRanges = UCRC.Count; // 3
// this true because collection contains the exact range
bool thisIsTrue = UCRC.Contains(new UnicodeCharacterRange('A', 26));
// this is false because collection does not contain exact range
bool thisIsFalse = UCRC.Contains(new UnicodeCharacterRange('a', 25));
// does not remove because the exact range: '0', 11 does not exist
UCRC.Remove(new UnicodeCharacterRange('0', 11));
// removes because the exact range '0', 10 does exist
UCRC.Remove(new UnicodeCharacterRange('0', 10));
int newCountOfRanges = UCRC.Count; // 2
// idxOfLowerCase = 1 (2nd range added)
int idxOfLowerCase = UCRC.IndexOf(new UnicodeCharacterRange('a', 26));
// idxOfDigits = -1 because that range does not exist (it was removed)
int idxOfDigits = UCRC.IndexOf(new UnicodeCharacterRange('0', 10));
// create an array of UnicodeCharacterRange
UnicodeCharacterRange[] UCRArray = new UnicodeCharacterRange[UCRC.Count];
// copy from the collection to the array
UCRC.CopyTo(UCRArray, 0);
Plateformes
Windows Vista
Le .NET Framework et le .NET Compact Framework ne prennent pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Informations de version
.NET Framework
Pris en charge dans : 3.0
Voir aussi
Référence
UnicodeCharacterRangeCollection, classe