現在の UnicodeCharacterRangeCollection コレクションのすべての要素を、指定された 1 次元配列の、指定された配列インデックスから開始する位置にコピーします。
名前空間 : Microsoft.Ink
アセンブリ : Microsoft.Ink.Analysis (Microsoft.Ink.Analysis.dll 内)
構文
'宣言
Public Sub CopyTo ( _
array As UnicodeCharacterRange(), _
index As Integer _
)
'使用
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
)
パラメータ
- array
型 : array<Microsoft.Ink.UnicodeCharacterRange[]
コレクションからの要素のコピー先である 1 次元配列。この配列では、0 から始まるインデックスを使用する必要があります。
- index
型 : System.Int32
配列パラメータ内の、コピーを開始する位置を表すインデックス番号 (0 から始まる)。
例
この例では、UnicodeCharacterRangeCollection がインスタンス化され、このインスタンスに対して複数の操作が実行されます。
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);
プラットフォーム
Windows Vista
.NET Framework および .NET Compact Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
バージョン情報
.NET Framework
サポート対象 : 3.0
参照
参照
UnicodeCharacterRangeCollection クラス