Assembly: Microsoft.VisualStudio.Shell.Design (in microsoft.visualstudio.shell.design.dll)
/** @attribute CLSCompliantAttribute(false) */ public final class GlobalObjectService implements IDisposable
The GlobalObjectService class is queried by design-time tools to obtain information about available global objects and types. Theand methods return collections containing the currently available global objects and global types, respectively. GlobalObjectService is commonly queried by the objects of type and .
When the designer loader is initialized, it creates a single instance of the global object service which it associates with the design surface. With this arrangement, global objects can be persisted flexibly, using an arbitrary serialization scheme. Internally, the global object service performs the following duties:
It queries the various global object providers for global objects. Each global object returned is queried for a compatible serializer, and if none is found, that global object is discarded because it cannot be serialized.
It maintains a table of global objects. This table tracks which global objects came from which provider. After a global object is added to the table, the global object service listens for events on the global object.
When a global object’s instance is created, it adds metadata to the instance so it can be serialized. The serializer is obtained by a call toon the global object itself.
It monitors the change events for each global object. When a change event is raised the global object service raises anevent to the dynamic type service for each unique assembly. It passes an array of types into the event as well, so those listening know exactly what types are valid. This list is built up in two passes in response to the and events. The monitors AssemblyObsolete events and reloads the designer if the assembly contained within the event is being used by the designer.