OrderedDictionary.Values プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > OrderedDictionary.Values プロパティの意味・解説 

OrderedDictionary.Values プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

OrderedDictionary コレクションの値を保持している ICollection オブジェクト取得します

名前空間: System.Collections.Specialized
アセンブリ: System (system.dll 内)
構文構文

Dim instance As OrderedDictionary
Dim value As ICollection

value = instance.Values
public ICollection Values { get; }
public:
virtual property ICollection^ Values {
    ICollection^ get () sealed;
}
/** @property */
public final ICollection get_Values ()

プロパティ
OrderedDictionary コレクションの値を保持している ICollection オブジェクト

解説解説

返される ICollection オブジェクト静的コピーではありません。代わりに、この ICollection は、元の OrderedDictionary コレクションの値を参照します。そのため、OrderedDictionary対す変更は、ICollection にも反映されます。

使用例使用例

OrderedDictionary コレクション作成してデータ読み込み内容コンソール出力するコード例次に示します。この例では、内容表示するメソッドKeys プロパティValues プロパティ渡されます。このコードは、OrderedDictionary参照できるコード例一部です。

' Creates and initializes a OrderedDictionary.
Dim myOrderedDictionary As New
 OrderedDictionary()
myOrderedDictionary.Add("testKey1", "testValue1")
myOrderedDictionary.Add("testKey2", "testValue2")
myOrderedDictionary.Add("keyToDelete", "valueToDelete")
myOrderedDictionary.Add("testKey3", "testValue3")

Dim keyCollection As ICollection = myOrderedDictionary.Keys
Dim valueCollection As ICollection = myOrderedDictionary.Values

' Display the contents Imports the key and value collections
DisplayContents( _
    keyCollection, valueCollection, myOrderedDictionary.Count)
// Creates and initializes a OrderedDictionary.
OrderedDictionary myOrderedDictionary = new OrderedDictionary();
myOrderedDictionary.Add("testKey1", "testValue1");
myOrderedDictionary.Add("testKey2", "testValue2");
myOrderedDictionary.Add("keyToDelete", "valueToDelete");
myOrderedDictionary.Add("testKey3", "testValue3");

ICollection keyCollection = myOrderedDictionary.Keys;
ICollection valueCollection = myOrderedDictionary.Values;

// Display the contents using the key and value collections
DisplayContents(keyCollection, valueCollection, myOrderedDictionary.Count);
' Displays the contents of the OrderedDictionary from its keys and values
Public Shared Sub DisplayContents(
 _
    ByVal keyCollection As ICollection, _
    ByVal valueCollection As ICollection, ByVal
 dictionarySize As Integer)

    Dim myKeys(dictionarySize) As [String]
    Dim myValues(dictionarySize) As [String]
    keyCollection.CopyTo(myKeys, 0)
    valueCollection.CopyTo(myValues, 0)

    ' Displays the contents of the OrderedDictionary
    Console.WriteLine("   INDEX KEY                       VALUE")
    Dim i As Integer
    For i = 0 To dictionarySize - 1
        Console.WriteLine("   {0,-5} {1,-25} {2}",
 _
             i, myKeys(i), myValues(i))
    Next i
    Console.WriteLine()
End Sub
// Displays the contents of the OrderedDictionary from its keys and
 values
public static void DisplayContents(
    ICollection keyCollection, ICollection valueCollection, int
 dictionarySize)
{
    String[] myKeys = new String[dictionarySize];
    String[] myValues = new String[dictionarySize];
    keyCollection.CopyTo(myKeys, 0);
    valueCollection.CopyTo(myValues, 0);

    // Displays the contents of the OrderedDictionary
    Console.WriteLine("   INDEX KEY                       VALUE");
    for (int i = 0; i < dictionarySize;
 i++)
    {
        Console.WriteLine("   {0,-5} {1,-25} {2}",
            i, myKeys[i], myValues[i]);
    }
    Console.WriteLine();
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OrderedDictionary クラス
OrderedDictionary メンバ
System.Collections.Specialized 名前空間


このページでは「.NET Framework クラス ライブラリ リファレンス」からOrderedDictionary.Values プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からOrderedDictionary.Values プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からOrderedDictionary.Values プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

OrderedDictionary.Values プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



OrderedDictionary.Values プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS