IDictionary.IsReadOnly 屬性

定義

取得值,這個值表示 IDictionary 物件是否唯讀。Gets a value indicating whether the IDictionary object is read-only.

public:
 property bool IsReadOnly { bool get(); };
public bool IsReadOnly { get; }
member this.IsReadOnly : bool
Public ReadOnly Property IsReadOnly As Boolean

屬性值

如果 IDictionary 物件是唯讀,則為 true,否則為 falsetrue if the IDictionary object is read-only; otherwise, false.

範例

下列程式碼範例示範如何執行IsReadOnly屬性。The following code example demonstrates how to implement the IsReadOnly property. 這個程式碼範例是針對IDictionary類別提供之較大範例的一部分。This code example is part of a larger example provided for the IDictionary class.

public:
    property virtual bool IsReadOnly
    {
        bool get()
        {
            return false;
        }
    }
public bool IsReadOnly { get { return false; } }
Public ReadOnly Property IsReadOnly() As Boolean Implements IDictionary.IsReadOnly
    Get
        Return False
    End Get
End Property

備註

唯讀的集合不允許在集合建立後增加、移除或修改項目。A collection that is read-only does not allow the addition, removal, or modification of elements after the collection is created.

適用於