IContainer.Add 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
将指定的组件添加到 .IContainer
重载
| 名称 | 说明 |
|---|---|
| Add(IComponent) |
将指定的 IComponent 值添加到 IContainer 列表末尾。 |
| Add(IComponent, String) |
将指定 IComponent 添加到 IContainer 列表末尾,并向组件分配名称。 |
Add(IComponent)
- Source:
- IContainer.cs
- Source:
- IContainer.cs
将指定的 IComponent 值添加到 IContainer 列表末尾。
public:
void Add(System::ComponentModel::IComponent ^ component);
public void Add(System.ComponentModel.IComponent? component);
public void Add(System.ComponentModel.IComponent component);
abstract member Add : System.ComponentModel.IComponent -> unit
Public Sub Add (component As IComponent)
参数
- component
- IComponent
要 IComponent 添加的。
注解
IComponent新内容将添加到列表末尾。
适用于
Add(IComponent, String)
- Source:
- IContainer.cs
- Source:
- IContainer.cs
将指定 IComponent 添加到 IContainer 列表末尾,并向组件分配名称。
public:
void Add(System::ComponentModel::IComponent ^ component, System::String ^ name);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")]
public void Add(System.ComponentModel.IComponent? component, string? name);
public void Add(System.ComponentModel.IComponent? component, string? name);
public void Add(System.ComponentModel.IComponent component, string name);
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("The Type of components in the container cannot be statically discovered to validate the name.")>]
abstract member Add : System.ComponentModel.IComponent * string -> unit
abstract member Add : System.ComponentModel.IComponent * string -> unit
Public Sub Add (component As IComponent, name As String)
参数
- component
- IComponent
要 IComponent 添加的。
- 属性
注解
IComponent新内容将添加到列表末尾。
实施者说明
当你继承自 Add(IComponent)时,你必须确保 name,如果不是 null,这是独一无二的 IContainer。