IContainer.Add 方法

定義

將指定的元件加入 IContainerAdds the specified component to the IContainer.

多載

Add(IComponent)

在清單結尾處,將指定的 IComponent 加入 IContainerAdds the specified IComponent to the IContainer at the end of the list.

Add(IComponent, String)

在清單結尾處,將指定的 IComponent 加入 IContainer,並指派名稱給元件。Adds the specified IComponent to the IContainer at the end of the list, and assigns a name to the component.

Add(IComponent)

在清單結尾處,將指定的 IComponent 加入 IContainerAdds the specified IComponent to the IContainer at the end of the list.

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

要加入的 IComponentThe IComponent to add.

備註

新的 IComponent 會加入至清單的結尾。The new IComponent is added at the end of the list.

適用於

產品 Introduced

Add(IComponent, String)

在清單結尾處,將指定的 IComponent 加入 IContainer,並指派名稱給元件。Adds the specified IComponent to the IContainer at the end of the list, and assigns a name to the component.

public:
 void Add(System::ComponentModel::IComponent ^ component, System::String ^ name);
public void Add (System.ComponentModel.IComponent component, string name);
abstract member Add : System.ComponentModel.IComponent * string -> unit
Public Sub Add (component As IComponent, name As String)

參數

component
IComponent

要加入的 IComponentThe IComponent to add.

name
String

要指派給元件的唯一、不區分大小寫的名稱。The unique, case-insensitive name to assign to the component.

-或--or- null,表示沒有為元件命名。null that leaves the component unnamed.

備註

新的 IComponent 會加入至清單的結尾。The new IComponent is added at the end of the list.

給實施者的注意事項

當您繼承自時 Add(IComponent) ,您必須確定 name ,如果不 null 是,則對這個而言是唯一的 IContainerWhen you inherit from Add(IComponent), you must assure that name, if not null, is unique for this IContainer.

適用於

產品 Introduced