Container.Add 方法

定義

Component 加入至 Container

多載

名稱 Description
Add(IComponent)

將指定的 ComponentContainer加入 。 該元件未命名。

Add(IComponent, String)

將指定的 Component 加入 並 Container 賦予其名稱。

Add(IComponent)

來源:
Container.cs
來源:
Container.cs
來源:
Container.cs
來源:
Container.cs
來源:
Container.cs

將指定的 ComponentContainer加入 。 該元件未命名。

public:
 virtual void Add(System::ComponentModel::IComponent ^ component);
public virtual void Add(System.ComponentModel.IComponent? component);
public virtual void Add(System.ComponentModel.IComponent component);
abstract member Add : System.ComponentModel.IComponent -> unit
override this.Add : System.ComponentModel.IComponent -> unit
Public Overridable Sub Add (component As IComponent)

參數

component
IComponent

要加的元件。

實作

例外狀況

componentnull

備註

此方法可被派生類別覆蓋。

Component 項目會被加到清單的最後。

另請參閱

適用於

Add(IComponent, String)

來源:
Container.cs
來源:
Container.cs
來源:
Container.cs
來源:
Container.cs
來源:
Container.cs

將指定的 Component 加入 並 Container 賦予其名稱。

public:
 virtual 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 virtual void Add(System.ComponentModel.IComponent? component, string? name);
public virtual 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
override this.Add : System.ComponentModel.IComponent * string -> unit
abstract member Add : System.ComponentModel.IComponent * string -> unit
override this.Add : System.ComponentModel.IComponent * string -> unit
Public Overridable Sub Add (component As IComponent, name As String)

參數

component
IComponent

要加的元件。

name
String

唯一且不區分大小寫的名稱。

-或-

null,這使得該元件未命名。

實作

屬性

例外狀況

componentnull

name 並不獨特。

備註

此方法可被派生類別覆蓋。

Component 項目會被加到清單的最後。

另請參閱

適用於