Share via


IVsaEngine.IsDirty Property

Gets a Boolean value that reports whether the script engine's source state has changed since the last save operation, or since the script engine was originally loaded.

public: __property bool get_IsDirty();
public bool IsDirty {get;}
Public Property Get IsDirty() As Boolean

Return Value

Returns true if the script engine is marked as modified (i.e., "dirty"). Returns false if the script engine is not dirty. The default value for this property is false.

Remarks

Any changes to properties of the script engine itself, including extensible properties set using the IVsaEngine.SetOption method, and any changes made to items contained in the IVsaEngine.Items collection, will cause the script engine to be marked as modified.

This property can be used to optimize persistence. As a further optimization, if the IsDirty property is set to false, then there is nothing to persist. If the IsDirty property is set to true, then the individual items within the script engine can be checked for their IVsaItem.IsDirty property to see whether they need to be persisted.

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

EngineNotInitialized

The engine has not been initialized.

See Also

Reference

IVsaEngine Interface

IVsaEngine.SetOption Method

IVsaItem.IsDirty Property