SortedList.Values プロパティ
アセンブリ: System (system.dll 内)

SortedList 内のキーを格納している IList。

IList 内の値の順序は、SortedList 内での順序と同じです。
返される IList は静的なコピーではありません。代わりに、この IList は、元の SortedList の値を参照します。そのため、SortedList に対する変更は、IList にも反映されます。
Values プロパティによって返されるコレクションを使用すると、値を効率的にインデックスで取得できます。リストは値の内部配列の単なるラッパーなので、プロパティへのアクセス時にリストを再生成する必要はありません。Values プロパティを使用して、文字列の並べ替えられたリストの値をインデックスで取得するコード例を次に示します。

このコード例では、Values プロパティを使用して並べ替えられたリストの値を列挙する方法、および並べ替えられたリストのキーと値を列挙する方法を示します。
この例では、Values プロパティを使用して、値をインデックスで効率的に取得する方法も示します。
このコード例は、SortedList クラスのトピックで取り上げているコード例の一部分です。
' To get the values alone, use the Values property. Dim ilistValues As IList(Of String) = openWith.Values ' The elements of the list are strongly typed with the ' type that was specified for the SortedList values. Console.WriteLine() For Each s As String In ilistValues Console.WriteLine("Value = {0}", s) Next s ' The Values property is an efficient way to retrieve ' values by index. Console.WriteLine(vbLf & "Indexed retrieval using the " & _ "Values property: Values(2) = {0}", openWith.Values(2)) <br /><span space="preserve">...</span><br /> ' When you use foreach to enumerate list elements, ' the elements are retrieved as KeyValuePair objects. Console.WriteLine() For Each kvp As KeyValuePair(Of String, String) In openWith Console.WriteLine("Key = {0}, Value = {1}", _ kvp.Key, kvp.Value) Next kvp
// To get the values alone, use the Values property. IList<string> ilistValues = openWith.Values; // The elements of the list are strongly typed with the // type that was specified for the SorteList values. Console.WriteLine(); foreach( string s in ilistValues ) { Console.WriteLine("Value = {0}", s); } // The Values property is an efficient way to retrieve // values by index. Console.WriteLine("\nIndexed retrieval using the Values " + "property: Values[2] = {0}", openWith.Values[2]); <br /><span space="preserve">...</span><br /> // When you use foreach to enumerate list elements, // the elements are retrieved as KeyValuePair objects. Console.WriteLine(); foreach( KeyValuePair<string, string> kvp in openWith ) { Console.WriteLine("Key = {0}, Value = {1}", kvp.Key, kvp.Value); }

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SortedList ジェネリック クラス
SortedList メンバ
System.Collections.Generic 名前空間
IList ジェネリック インターフェイス
SortedList.Keys プロパティ
SortedList.Values プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)


ICollection は、SortedList の値の読み取り専用ビューです。基になる SortedList が変更されると、その変更はすぐに ICollection に反映されます。
ICollection の要素は、SortedList の値と同じ順序で並べ替えられます。

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


Weblioに収録されているすべての辞書からSortedList.Valuesを検索する場合は、下記のリンクをクリックしてください。

- SortedList.Valuesのページへのリンク