Dictionary.Values プロパティ
アセンブリ: mscorlib (mscorlib.dll 内)

Dictionary 内の値を格納している Dictionary.ValueCollection。

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

このコード例では、Values プロパティを使用してディクショナリの値を列挙する方法およびディクショナリのキーと値を列挙する方法を示します。
このコード例は、Dictionary クラスのトピックで取り上げているコード例の一部分です。
' To get the values alone, use the Values property. Dim valueColl As _ Dictionary(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. Dictionary<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 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 によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


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

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