In a comment to an earlier post, Tim Dawson pointed out that there are some significant improvements with respect to design surfaces in the upcoming .NET Framework 2.0. I was going to get to that after I covered what bits need to be assembled in order to get a design surface to work. Instead, I will modify my table now to indicate what the new Framework brings. Here is some info from MSDN2:
----------
The new DesignSurface class implements what the user perceives as a designer. DesignSurface is the user interface the user manipulates to change design-time features. DesignSurface provides a completely self-contained design surface.
The DesignSurface class may be used as a stand-alone designer, or it may be coupled with DesignSurfaceManager to provide a common implementation for an application that hosts multiple DesignSurface objects.
The DesignSurface class can be used by itself, or the user can derive a new class from it and augment the behavior.
The DesignSurface class provides several design-time services automatically. The DesignSurface class adds all of its services in its constructor. Most of these services can be overridden by replacing them in the protected ServiceContainer property. To replace a service, override the constructor, call base, and make any changes through the protected ServiceContainer property. All services added to the service container that implement IDisposable are disposed when the design surface is disposed.
The DesignSurface class also provides a single service that is available through a component's site. This service is unique for each component. In addition to ISite, the site also implements IDictionaryService interface. Check for the existence of this or other interfaces, rather than use indiscriminate casting, because other site implementations may not implement them.
----------
The codes for the following tables are as follows:
- DH - Interface is implemented in the DesignerHost class
- SF - Interface/class is implemented in a separate file
- NI - Interface is not implemented, but commented stubs do exist
- DEF - Uses the default implementation of the service
- DR - DesignSurface class provides a default service that is replaceable
- DN - DesignSurface class provides a default service that is not replaceable
Here are the classes and non-service interfaces.
Classes/Interfaces |MSKB|MSDN|Dawson|2.0| Namespace
DesignerAttributeService | -- | -- | -- |DR | System.ComponentModel.Design
DesignerLoader | SF | | | | System.ComponentModel.Design.Serialization
DesignerTransaction | SF | SF | SF |DN | System.ComponentModel.Design
DesignSurface | -- | -- | -- |DR | System.ComponentModel.Design
IContainer | DH | DH | DH | | System.ComponentModel
IComponent | | | | | System.ComponentModel
IDesigner | | | | | System.ComponentModel.Design
IDesignerFilter | | | | | System.ComponentModel.Design
IDesignerHost | DH | DH | DH |DN | System.ComponentModel.Design
IDesignerLoaderHost | DH | | | | System.ComponentModel.Design.Serialization
IDisposable | DH | DH | | | System
IExtenderProvider | SF | | DH | | System.ComponentModel
IRootDesigner | SF | | | | System.ComponentModel.Design
ISite | SF | SF | SF | | System.ComponentModel
This table shows just the service interfaces that are/can be implemented.
Service Interfaces |MSKB|MSDN|Dawson|2.0| Namespace
IComponentChangeService | DH | DH | DH |DN | System.ComponentModel.Design
IDesignerEventService | DH | DH | | | System.ComponentModel.Design
IDesignerOptionService | | | | | System.ComponentModel.Design
IDesignerLoaderService | | | | | System.ComponentModel.Design.Serialization
IDesignerSerializationManager | SF | | | | System.ComponentModel.Design.Serialization
IDesignerSerializationProvider| | | | | System.ComponentModel.Design.Serialization
IDesignerSerializationService | | | | | System.ComponentModel.Design.Serialization
IDictionaryService | SF | SF | SF |DN | System.ComponentModel.Design
IEventBindingService | SF | | | | System.ComponentModel.Design
IExtenderListService | | | DH |DR | System.ComponentModel.Design
IExtenderProviderService | DH | DH | DH |DR | System.ComponentModel.Design
IHelpService | NI | | | | System.ComponentModel.Design
IMenuCommandService | SF | SF | SF | | System.ComponentModel.Design
IMenuEditorService | NI | | | | System.Windows.Forms.Design
INameCreationService | DEF| SF | SF | | System.ComponentModel.Design.Serialization
IPropertyValueUIService | NI | | | | System.Drawing.Design
IReferenceService | NI | | |DR | System.ComponentModel.Design
IResourceService | SF | | | | System.ComponentModel.Design
ISelectionService | SF | SF | SF |DR | System.ComponentModel.Design
IServiceContainer | DH | DH | DH |DN | System.ComponentModel.Design
IServiceProvider | DH | DH | SF |DN | System
IToolboxService | SF | SF | SF | | System.Drawing.Design
ITypeDescriptorFilterService | SF | SF | DH |DR | System.ComponentModel.Design
ITypeResolutionService | SF | | | | System.ComponentModel.Design
IUIService | | | SF | | System.Windows.Forms.Design
Next: What do these default services and classses do in support of the new DesignSurface class?