Container 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
封裝零個或多個元件。
public ref class Container : IDisposable, System::ComponentModel::IContainer
public ref class Container : System::ComponentModel::IContainer
public class Container : IDisposable, System.ComponentModel.IContainer
public class Container : System.ComponentModel.IContainer
type Container = class
interface IContainer
interface IDisposable
Public Class Container
Implements IContainer, IDisposable
Public Class Container
Implements IContainer
- 繼承
-
Container
- 衍生
- 實作
備註
該 Container 類別是介面 IContainer 的預設實作。
容器是封裝並追蹤零個或多個元件的物件。 在此語境中,「收容」指的是邏輯上的「收容」,而非視覺上的「收容」。 你可以在各種情境中使用元件和容器,包括視覺化與非視覺化的情境。
容器中的元件會以先入先出清單追蹤,該清單同時定義元件在容器內的順序。 新增的元件會附加在清單末尾。
建構函式
| 名稱 | Description |
|---|---|
| Container() |
初始化 Container 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| Components |
取得所有元件。Container |
方法
| 名稱 | Description |
|---|---|
| Add(IComponent, String) | |
| Add(IComponent) | |
| CreateSite(IComponent, String) |
為該網站IComponent建立ISite一個網站,並將該名稱指派給該網站。 |
| Dispose() |
釋放所有由 Container. |
| Dispose(Boolean) |
釋放 所使用的 Container未管理資源,並可選擇性地釋放受管理資源。 |
| Equals(Object) |
判斷指定的 物件是否等於目前的物件。 (繼承來源 Object) |
| Finalize() |
在被垃圾回收前釋放未管理的資源並執行其他清理作業 Container 。 |
| GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
| GetService(Type) |
取得指定類型的服務物件(若可用)。 |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| Remove(IComponent) |
從 中移除一個元件。Container |
| RemoveWithoutUnsiting(IComponent) | |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |
| ValidateName(IComponent, String) |
判斷該容器的元件名稱是否唯一。 |