Component.Site Component.Site Component.Site Component.Site Property

定義

取得或設定 ComponentISiteGets or sets the ISite of the Component.

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; }
member this.Site : System.ComponentModel.ISite with get, set
Public Overridable Property Site As ISite

屬性值

ISite 關聯的 Component。如果 Component 未封裝在 IContainerComponent 沒有關聯的 ISite,或 Component 從其 IContainer 移除,則為 nullThe ISite associated with the Component, or null if the Component is not encapsulated in an IContainer, the Component does not have an ISite associated with it, or the Component is removed from its IContainer.

實作

備註

AComponent會有ISite如果加入至IContainerIContainer指派ISite給它。A Component will have an ISite if it has been added to an IContainer and the IContainer assigns an ISite to it. IContainer負責指派ISiteComponentThe IContainer is responsible for assigning the ISite to the Component. 變更元件的值ISite並不一定會變更站台名稱Component指派給。Changing the value of the component's ISite does not necessarily change the name of the site the Component is assigned to. Site屬性應該僅設定IContainerThe Site property should be set only by an IContainer.

屬性值,則null如果Component移除從其IContainerThe property value is null if the Component is removed from its IContainer. 指派null給這個屬性不一定會移除ComponentIContainerAssigning null to this property does not necessarily remove the Component from the IContainer.

AComponent可能會或可能沒有名稱。A Component might or might not have a name. 如果Component是指定名稱,名稱必須是唯一的其他Component內的物件及其IContainerIf a Component is given a name, the name must be unique among other Component objects within its IContainer. ISite的名稱儲存Component; 因此,您只可以命名ComponentISite與其相關聯。The ISite stores the name of the Component; therefore, you can only name a Component if it has an ISite associated with it.

適用於

另請參閱