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

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

OrderedDictionary.Count プロパティ

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

OrderedDictionary コレクション格納されているキー/値ペアの数を取得します

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

使用例使用例

OrderedDictionary コレクション変更方法を示すコード例次に示します。この例では、Count プロパティ使用してOrderedDictionary 内の最後の項目を削除します。このコードは、OrderedDictionary参照できるコード例一部です。

' Modifying the OrderedDictionary
If Not myOrderedDictionary.IsReadOnly Then

    ' Insert a new key to the beginning of the OrderedDictionary
    myOrderedDictionary.Insert(0, "insertedKey1",
 "insertedValue1")

    ' Modify the value of the entry with the key "testKey2"
    myOrderedDictionary("testKey2") = "modifiedValue"

    ' Remove the last entry from the OrderedDictionary: "testKey3"
    myOrderedDictionary.RemoveAt(myOrderedDictionary.Count - 1)

    ' Remove the "keyToDelete" entry, if it exists
    If (myOrderedDictionary.Contains("keyToDelete"))
 Then
        myOrderedDictionary.Remove("keyToDelete")
    End If
End If
// Modifying the OrderedDictionary
if (!myOrderedDictionary.IsReadOnly)
{
    // Insert a new key to the beginning of the OrderedDictionary
    myOrderedDictionary.Insert(0, "insertedKey1", "insertedValue1");

    // Modify the value of the entry with the key "testKey2"
    myOrderedDictionary["testKey2"] = "modifiedValue";

    // Remove the last entry from the OrderedDictionary: "testKey3"
    myOrderedDictionary.RemoveAt(myOrderedDictionary.Count - 1);

    // Remove the "keyToDelete" entry, if it exists
    if (myOrderedDictionary.Contains("keyToDelete"))
    {
        myOrderedDictionary.Remove("keyToDelete");
    }
}
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
OrderedDictionary クラス
OrderedDictionary メンバ
System.Collections.Specialized 名前空間



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

辞書ショートカット

すべての辞書の索引

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

   

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



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

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

©2025 GRAS Group, Inc.RSS