IListSource.ContainsListCollection 屬性

定義

取得值,指出此集合是否為 IList 物件的集合。Gets a value indicating whether the collection is a collection of IList objects.

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

屬性值

Boolean

如果集合為 IList 物件的集合,則為 true,否則為 falsetrue if the collection is a collection of IList objects; otherwise, false.

範例

下列程式碼範例示範如何執行 IListSource 介面。The following code example demonstrates how to implement the IListSource interface. 名為的元件 EmployeeListSource 表示,它不包含 IList 從方法傳回的資料系結 false ContainsListCollectionA component named EmployeeListSource indicates that it does not contain an IList for data binding by returning false from the ContainsListCollection method. 如需完整的程式代碼清單,請參閱 如何:執行 IListSource 介面For a full code listing, see How to: Implement the IListSource Interface.

bool IListSource.ContainsListCollection
{
    get { return false; }
}
Public ReadOnly Property ContainsListCollection() As Boolean Implements System.ComponentModel.IListSource.ContainsListCollection
    Get
        Return False
    End Get
End Property

備註

使用中的這個屬性會傳回 DataSet true ,因為 DataSet 類別包含集合的集合。Using this property in DataSet returns true because the DataSet class contains a collection of collections. 在中使用這個 DataTable 屬性 false ,因為 DataTable 類別包含物件的集合。Using this property in DataTable returns false because the DataTable class contains a collection of objects.

適用於

另請參閱