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

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

OrderedDictionary.IsReadOnly プロパティ

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

OrderedDictionary コレクションが読み取り専用かどうかを示す値を取得します。

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

Dim instance As OrderedDictionary
Dim value As Boolean

value = instance.IsReadOnly
public bool IsReadOnly { get;
 }
/** @property */
public final boolean get_IsReadOnly ()

プロパティ値
OrderedDictionary コレクションが読み取り専用の場合は true。それ以外の場合は false。既定値は false です。

解説解説
使用例使用例

OrderedDictionary コレクションの変更方法を示すコード例を次に示します。この例では、IsReadOnly プロパティを使用して、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 名前空間



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

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

   

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



OrderedDictionary.IsReadOnly プロパティのページの著作権

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

©2026 GRAS Group, Inc.RSS