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

Private ReadOnly Property System.Collections.IDictionary.Values As ICollection Implements IDictionary.Values
Dim instance As SortedDictionary(Of TKey, TValue) Dim value As ICollection value = CType(instance, IDictionary).Values
private: virtual property ICollection^ System.Collections.IDictionary.Values { ICollection^ get () sealed = IDictionary::Values::get; }
IDictionary 内の値を格納している ICollection。


SortedDictionary で、System.Collections.IDictionary インターフェイスの System.Collections.IDictionary.Values プロパティを使用して、ディクショナリの値を一覧表示する方法を次のコード例に示します。この例では、ディクショナリのキー/値ペアを列挙する方法も示します。System.Collections.IDictionary インターフェイスの列挙子が KeyValuePair オブジェクトではなく DictionaryEntry オブジェクトを返すことに注意してください。
次のコード例は、System.Collections.IDictionary.Add メソッドのトピックで取り上げている例および出力の一部分です。
Imports System Imports System.Collections Imports System.Collections.Generic Public Class Example Public Shared Sub Main() ' Create a new sorted dictionary of strings, with string keys , ' and access it using the IDictionary interface. ' Dim openWith As IDictionary = _ New SortedDictionary(Of String, String) ' Add some elements to the dictionary. There are no ' duplicate keys, but some of the values are duplicates. ' IDictionary.Add throws an exception if incorrect types ' are supplied for key or value. openWith.Add("txt", "notepad.exe") openWith.Add("bmp", "paint.exe") openWith.Add("dib", "paint.exe") openWith.Add("rtf", "wordpad.exe") <br /><span space="preserve">...</span><br /> ' To get the values alone, use the Values property. Dim icoll As ICollection = openWith.Values ' The elements of the collection are strongly typed ' with the type that was specified for dictionary values, ' even though the ICollection interface is not strongly ' typed. Console.WriteLine() For Each s As String In icoll Console.WriteLine("Value = {0}", s) Next s <br /><span space="preserve">...</span><br /> ' When you use foreach to enumerate dictionary elements ' with the IDictionary interface, the elements are retrieved ' as DictionaryEntry objects instead of KeyValuePair objects. Console.WriteLine() For Each de As DictionaryEntry In openWith Console.WriteLine("Key = {0}, Value = {1}", _ de.Key, de.Value) Next <br /><span space="preserve">...</span><br /> End Sub End Class
using System; using System.Collections; using System.Collections.Generic; public class Example { public static void Main() { // Create a new sorted dictionary of strings, with string keys , // and access it using the IDictionary interface. // IDictionary openWith = new SortedDictionary<string, string>(); // Add some elements to the dictionary. There are no // duplicate keys, but some of the values are duplicates. // IDictionary.Add throws an exception if incorrect types // are supplied for key or value. openWith.Add("txt", "notepad.exe"); openWith.Add("bmp", "paint.exe"); openWith.Add("dib", "paint.exe"); openWith.Add("rtf", "wordpad.exe"); <br /><span space="preserve">...</span><br /> // To get the values alone, use the Values property. ICollection icoll = openWith.Values; // The elements of the collection are strongly typed // with the type that was specified for dictionary values, // even though the ICollection interface is not strongly // typed. Console.WriteLine(); foreach( string s in icoll ) { Console.WriteLine("Value = {0}", s); } <br /><span space="preserve">...</span><br /> // When you use foreach to enumerate dictionary elements // with the IDictionary interface, the elements are retrieved // as DictionaryEntry objects instead of KeyValuePair objects. Console.WriteLine(); foreach( DictionaryEntry de in openWith ) { Console.WriteLine("Key = {0}, Value = {1}", de.Key, de.Value); } <br /><span space="preserve">...</span><br /> } }

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 名前空間
ICollection インターフェイス
Weblioに収録されているすべての辞書からSortedDictionary.System.Collections.IDictionary.Values プロパティを検索する場合は、下記のリンクをクリックしてください。

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