GlobalObject::Instance Property

 

Gets an on-demand created instance of the global object.

Namespace:   Microsoft.VisualStudio.Shell.Design
Assembly:  Microsoft.VisualStudio.Shell.Design (in Microsoft.VisualStudio.Shell.Design.dll)

public:
property Object^ Instance {
	Object^ get();
}

Property Value

Type: System::Object^

An Object that represents an instance of the global object class.

Exception Condition
InvalidOperationException

The resulting instance is not serializable, which indicates an incorrect implementation.

You can use the Instance property to create an actual instance of the global object represented by the current global object. This property is null if the global objects contains only static members.

A new instance is only created the first time this property is retrieved. Subsequent retrievals get the same object unless one or more of the PerformChange, PerformRemove or ClearInstance methods are called in the intervening period.

If a new instance is created that is not null, then a Created event is raised.

Return to top
Show: