NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Component.Site

Gets or sets the site of the Component.

[Visual Basic]
Overridable Public Property Site As ISite
[C#]
public ISite Site {virtual get; virtual set;}
[C++]
public: __property virtual ISite* get_Site();
public: __property virtual void set_Site(ISite*);
[JScript]
public function get Site() : ISite;
public function set Site(ISite);

Property Value

The ISite associated with the Component, if any.

a null reference (in Visual Basic Nothing) if the Component is not encapsulated in an IContainer, or the Component does not have an ISite associated with it, or the Component is being removed from its IContainer.

Exceptions

Exception Type Condition
InvalidOperationException The Component is not encapsulated in an IContainer.

-or-

The Component does not have an ISite associated with it.

Remarks

A Component can only have a ISite if it has been added to an IContainer and the IContainer assigns an ISite to it.

a null reference (Nothing) indicates that the Component is being removed from its IContainer; but assigning a null reference (Nothing) to this property does not necessarily remove the Component from the IContainer.

A Component may or may 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 Component 's name; therefore, a Component can only be named if it has an ISite associated with it.

See Also

Component Class | Component Members | System.ComponentModel Namespace | IContainer | Container | ISite