Export (0) Print
Expand All
0 out of 2 rated this helpful - Rate this topic

Component.Site Property

Gets or sets the ISite of the Component.

Namespace: System.ComponentModel
Assembly: System (in system.dll)

public virtual ISite Site { get; set; }
/** @property */
public ISite get_Site ()

/** @property */
public void set_Site (ISite value)

public function get Site () : ISite

public function set Site (value : ISite)

Not applicable.

Property Value

The ISite associated with the Component, or a null reference (Nothing in Visual Basic) 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.

A Component will have an ISite if it has been added to an IContainer and the IContainer assigns an ISite to it. The IContainer is responsible for assigning the ISite to the Component. Changing the value of the component's ISite does not necessarily change the name of the site the Component is assigned to. The Site property should be set only by an IContainer.

The property value is a null reference (Nothing in Visual Basic) if the Component is removed from its IContainer. Assigning a null reference (Nothing in Visual Basic) to this property does not necessarily remove the Component from the IContainer.

A Component might or might not have a name. If a Component is given a name, the name must be unique among other Component objects within its IContainer. The ISite stores the name of the Component; therefore, you can only name a Component if it has an ISite associated with it.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Supported in: 2.0

XNA Framework

Supported in: 1.0
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.