IVsaEngine.Site Property

Sets or gets the host-implemented IVsaSite object that is used by the script engine to communicate with the host.

public: _property IVsaSite* get_Site(); 
public: _property void set_Site(IVsaSite* value);
public IVsaSite Site { get; set; }
Property Get Site() As IVsaSite 
Public Property Set Site(ByVal value As IvsaSite)

Return Value

Returns a reference to the current IVsaSite object.

Remarks

Once the Site property has been set, it cannot be changed. Any attempt to set the Site property when the existing property value is non-null results in an exception, and the existing value is retained.

By default, the initial value of the Site property is a null reference. However, after setting the root moniker, the Site property must be set to reference a valid IVsaSite object before the following methods on the IVsaEngine interface can be called: Compile, Run, or InitNew.

The following table shows the exceptions that the Site property can throw.

Exception Type

Condition

EngineClosed

The IVsaEngine.Close method has been called and the engine is closed.

EngineBusy

The engine is currently executing code for another thread.

RootMonikerNotSet

The IVsaEngine.RootMoniker property has not been set.

SiteAlreadySet

The Site property cannot be set because it has already been set.

SiteInvalid

The Site property is set to an invalid value.

See Also

Reference

IVsaEngine Interface

IVsaSite Interface