Container 成员

封装零个或更多个组件。

下表列出了由 Container 类型公开的成员。

公共构造函数

  名称 说明
Public method Supported by the .NET Compact Framework Container 初始化 Container 类的新实例。

页首

公共属性

  名称 说明
Public property Components 获取 Container 中的所有组件。

页首

公共方法

(请参见 受保护的方法 )

  名称 说明
Public method Supported by the .NET Compact Framework Add 已重载。 向 Container 添加 Component
Public method Dispose 已重载。 释放由 Container 占用的资源。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework Remove Container 中移除组件。
Public method Supported by the .NET Compact Framework ToString  返回表示当前 ObjectString。 (从 Object 继承。)

页首

受保护的方法

  名称 说明
Protected method Supported by the .NET Compact Framework CreateSite 为给定的 IComponent 创建一个站点 ISite,并将给定名称分配给该站点。
Protected method Dispose 已重载。 释放由 Container 占用的资源。
Protected method Supported by the .NET Compact Framework Finalize 已重写。 在通过垃圾回收将 Container 回收之前,释放非托管资源并执行其他清理操作。
Protected method Supported by the .NET Compact Framework GetService 获取指定类型的服务对象(如果可用)。
Protected method Supported by the .NET Compact Framework MemberwiseClone  创建当前 Object 的浅表副本。 (从 Object 继承。)
Protected method RemoveWithoutUnsiting Container 中移除组件,不将 Site 设置为 空引用(在 Visual Basic 中为 Nothing)。
Protected method ValidateName 确定组件名称对此容器是否唯一。

页首

请参见

参考

Container 类
System.ComponentModel 命名空间
IContainer
IComponent
Component 类