Geeks With Blogs

News
Neat Stuff Read all my hurricane entries While you are here, visit the Geeks With Blogs main feed
Advertising
Links Status of the Navy
Channel 9

.NET Hobbyist Programmer Staying Confused in a Busy World

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?

Posted on Tuesday, January 11, 2005 8:10 PM Programming , Forms Designer | Back to top


Comments on this post: Custom Forms Designer: Framework 2.0

# re: .NET Custom Forms Designer: Framework 2.0
Requesting Gravatar...
I was looking for material for research about WindowsForms and found this site. I am starting to develop graphical interfaces, as well as a forms designer. Your texts are excellent. I yearning that you continues.
ps. I'm from Brazil and my english is not very good. :)
Left by Luciano Campos on Mar 02, 2005 3:42 PM

# re: .NET Custom Forms Designer: Framework 2.0
Requesting Gravatar...
I am very interested in the 2.0 Designer features, and was wondering what you have learnt so far

Cheers
Left by Bruce on May 08, 2005 11:07 PM

# re: .NET Custom Forms Designer: Framework 2.0
Requesting Gravatar...
Did you by any chance write some tesing bits for the new designer features?

Thanks.
Left by Alan on Feb 02, 2006 7:45 AM

# re: .NET Custom Forms Designer: Framework 2.0
Requesting Gravatar...
Excellent!Do you have some samples?
Left by Sean on Jan 15, 2007 11:45 PM

Your comment:
 (will show your gravatar)


Copyright © Mark Treadwell | Powered by: GeeksWithBlogs.net