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

Dim instance As SortedDictionary(Of TKey, TValue) Dim value As ValueCollection value = instance.Values
SortedDictionary 内のキーを格納している SortedDictionary.ValueCollection。

SortedDictionary.ValueCollection 内の値は、Comparer プロパティに従って並べ替えられ、関連付けられているキーが、Keys プロパティから返された SortedDictionary.KeyCollection 内で並べ替えられている順序と同じです。
返される SortedDictionary.ValueCollection は静的なコピーではありません。代わりに、この SortedDictionary.ValueCollection は、元の SortedDictionary の値を参照します。そのため、SortedDictionary に対する変更は、SortedDictionary.ValueCollection にも反映されます。

このコード例では、Values プロパティを使用してディクショナリの値を列挙する方法およびディクショナリのキーと値を列挙する方法を示します。
このコード例は、SortedDictionary クラスのトピックで取り上げているコード例の一部分です。
' To get the values alone, use the Values property. Dim valueColl _ As SortedDictionary(Of String, String).ValueCollection = _ openWith.Values ' The elements of the ValueCollection are strongly typed ' with the type that was specified for dictionary values. Console.WriteLine() For Each s As String In valueColl Console.WriteLine("Value = {0}", s) Next s <br /><span space="preserve">...</span><br /> ' When you use foreach to enumerate dictionary 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. SortedDictionary<string, string>.ValueCollection valueColl = openWith.Values; // The elements of the ValueCollection are strongly typed // with the type that was specified for dictionary values. Console.WriteLine(); foreach( string s in valueColl ) { Console.WriteLine("Value = {0}", s); } <br /><span space="preserve">...</span><br /> // When you use foreach to enumerate dictionary 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


SortedDictionary ジェネリック クラス
SortedDictionary メンバ
System.Collections.Generic 名前空間
SortedDictionary.ValueCollection
SortedDictionary.Keys プロパティ
Weblioに収録されているすべての辞書からSortedDictionary.Values プロパティを検索する場合は、下記のリンクをクリックしてください。

- SortedDictionary.Values プロパティのページへのリンク