共用方式為


Component.Site 屬性

定義

取得或設定 ISiteComponent

public:
 virtual property System::ComponentModel::ISite ^ Site { System::ComponentModel::ISite ^ get(); void set(System::ComponentModel::ISite ^ value); };
[System.ComponentModel.Browsable(false)]
public virtual System.ComponentModel.ISite? Site { get; set; }
[System.ComponentModel.Browsable(false)]
public virtual System.ComponentModel.ISite Site { get; set; }
[<System.ComponentModel.Browsable(false)>]
member this.Site : System.ComponentModel.ISite with get, set
Public Overridable Property Site As ISite

屬性值

ISite與 相關的 Component,若 Componentnull 未被封裝在 IContainer中,則 Component 不與 ISite 相關聯,或 Component 從其 IContainer中移除。

實作

屬性

備註

Component A 若被加入 an IContainerIContainer指派 a ISite 為 a,則 a 將 ISite a 加到該 a。 負責 IContainer 將 指 ISite 派到 Component。 改變元件 ISite 的值不一定會改變該 Component 元件所指派的站點名稱。 該 Site 屬性應該只由一個 IContainer來設定。

Component將 從其 IContainer中移除,則屬性值為 。nullnull 指派到此屬性不一定會從 中移除 。ComponentIContainer

A Component 可能有名字,也可能沒有。 若 a Component 被賦予一個名稱,該名稱必須在其 內的其他物件IContainerComponent是唯一的。 該ISite儲存名稱Component;因此,只有當 a 與 ISite 相關聯時,你才能命名 aComponent

適用於

另請參閱