Share via


IVsaEngine.InitNew Method

Provides a notification that the initialization phase is complete and that the script engine is prepared for the addition of IVsaItem objects.

public: void InitNew();
public void InitNew();
MustOverride Public Sub InitNew()

Remarks

Once a script engine has been initialized, by setting the IVsaEngine.RootMoniker and IVsaEngine.Site properties, the InitNew method must be called to enable the addition of IVsaItem objects.

Once the InitNew method has been called, the IVsaEngine.LoadSourceState method can no longer be called, nor can the InitNew method be called subsequently. Furthermore, either the InitNew or LoadSourceState methods must be called before items can be added to the engine using the IVsaItems.CreateItem method.

The following table shows the exceptions that the InitNew method 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.

EngineInitialized

The engine has already been initialized and cannot be initialized again.

RootMonikerNotSet

The IVsaEngine.RootMoniker property has not been set.

SiteNotSet

The IVsaEngine.Site property has not been set.

See Also

Reference

IVsaEngine Interface

IVsaItem Interface

IVsaItems.CreateItem Method

IVsaEngine.LoadSourceState Method