IDictionary.IsFixedSize IDictionary.IsFixedSize IDictionary.IsFixedSize IDictionary.IsFixedSize Property

定義

取得值,指出 IDictionary 物件是否具有固定的大小。Gets a value indicating whether the IDictionary object has a fixed size.

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

屬性值

如果 IDictionary 物件有固定大小,則為 true,否則為 falsetrue if the IDictionary object has a fixed size; otherwise, false.

範例

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

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

備註

具有固定大小的集合不允許在建立集合之後加入或移除專案, 但允許修改現有的專案。A collection with a fixed size does not allow the addition or removal of elements after the collection is created, but does allow the modification of existing elements.

具有固定大小的集合只是具有包裝函式的集合, 可防止新增和移除專案;因此, 如果對基礎集合進行了變更, 包括新增或移除元素, 則固定大小集合會反映這些變更。A collection with a fixed size is simply a collection with a wrapper that prevents adding and removing elements; therefore, if changes are made to the underlying collection, including the addition or removal of elements, the fixed-size collection reflects those changes.

適用於