Container.CreateSite(IComponent, String) 方法

定義

為指定的 ISite 建立站台 IComponent,並將指定的名稱指派給站台。Creates a site ISite for the given IComponent and assigns the given name to the site.

protected:
 virtual System::ComponentModel::ISite ^ CreateSite(System::ComponentModel::IComponent ^ component, System::String ^ name);
protected virtual System.ComponentModel.ISite CreateSite (System.ComponentModel.IComponent component, string name);
abstract member CreateSite : System.ComponentModel.IComponent * string -> System.ComponentModel.ISite
override this.CreateSite : System.ComponentModel.IComponent * string -> System.ComponentModel.ISite
Protected Overridable Function CreateSite (component As IComponent, name As String) As ISite

參數

component
IComponent

要為其建立站台的 IComponentThe IComponent to create a site for.

name
String

要指派給 component 的名稱,或 null,表示略過名稱的指派。The name to assign to component, or null to skip the name assignment.

傳回

新建立的站台。The newly created site.

備註

如果 null``name 參數,則 IComponent 會加入至不含識別名稱的 ContainerIf the name parameter is null, the IComponent is added to the Container without an identifying name.

衍生類別可以覆寫這個方法。This method can be overridden by a derived class. 需要覆寫 CreateSite 方法的實作者可以透過執行 ISite 介面的類別,提供自訂的執行。Implementers that need to override the CreateSite method can provide a custom implementation through a class that implements the ISite interface.

適用於