Before starting to code, the general toolkit architecture has to be defined.

Here is a summary of these design choices:

First of all, in order to avoid confusion between the control object (visual component) and the control class, I will call "widget" a "lightweight control".

In order to have lightweight widgets, the base class for all widget will be component. Component is a good candidate because even if it doesn’t provide a lot of things, it can be "sited" (understand: use ISite) and can appear on the Design Surface (with a lot of work).

The abstract class "WidgetBase" will be created. It will add to the component class all necessary features for being a good widget base class like:

  • Keyboard management
  • Mouse management
  • Data binding
  • Painting
  • Animation support

ContainerBase will inherit from WidgetBase and will manage a collection of widgetbase children.

By default, the winforms architecture does not allow to have components represented visually on the design surface (on the form). In order to bypass this limitation, widgets will be hosted by an "HostSurface", inheriting from ScrollableControl. We will call it HostSurfaceBase.

In order to provide an intuitive and easy to use design time, each widget will have an associated designer. It will allow:

  • Widget resizing;
  • Drag and Drop
  • Widget selection
  • Properties editing

A lot of design time features available for controls won’t be reusable. It will mean to redevelop quite a lot of things that already exist.

Mots clés Technorati : ,,,
Leave a Reply

Please enter 'aflava' without the quotes.