Ivan's Brain Dump


Mono.Design Report

Ivan N. Zlatev </span> </p>

Revision 3

# Summary ### Project Description This project targets at implementing the .Net Design-Time stack for the Mono Class Library, mostly hosted in the System.Design assembly and the \*.Design.\* namespaces. The stack consists of: * Design Surface, which includes a host and a list of design-time services * Windows.Forms Designers * ASP.Net Designers * Serializers and Deserializers ### Timeline 28 May – Start 9 July – Mid-Term Review 20 August – End ### **Delivered** Planned * DesignSurface, host and core design-time services * Windows.Forms core designers stack * Design-Time serialization stack * A simple frontend (the designer) to demonstrate how the above fit together. This includes drag and drop, resizing, selection, as well as source code serialization and deserialization. Extra * .Net 2.0 Updates * MonoDevelop Addin ### Schedule Per-week tasks-based schedule with weekly reports.
Week Activity Report
1 University Exams Link
2 Cover the existing code with unit tests to verify matching behavior with MS.Net. Link
3, 4, 5, 6 Research on and implement the serialization stack: designer loaders, serialization manager, serializers and all the missing classes in Mono’s class library required. Link
7 Implement the deserialization. Link
8 MonoDevelop integration work.
Revised to: “Port” to Mono – bugfixes in the class library, implementing missing classes.
Reason: Missing classes and bugs preventing the code form working on Mono.
9 Implement System.Windows.Forms.Design.Behavior.
Revised to:
MWF-in-GTK integration work.
Reason: No transparency (WS_EX_TRANSPARENT) on X11, which is required for the implementation.
10 MonoDevelop Windows.Forms designer Addin. Link
11 Vacation n/a
12 MonoDevelop Addin improvement work.
Revised to: Standalone WinForms Designer.
Reason: Unexpected, unresolvable issues with MWF-in-GTK.
### Development Environment Project managment: [http://monodt.ivanz.com][1]{#p1:q} Source code repository: [http://svn.ivanz.com/monodt][2]{#kwir} Editor: [SlickEdit][3]{#m_ja} Testing: [NUnit][4]{#wgtt} OS: [openSUSE 10.2 Linux][5]{#p5.c} Virtualization: [VirtualBox][6]{#lcmj} # Status ### Mono.Design Currently Mono.Design, but I hope the code will land in the Mono class library as soon as possible. Implemented are: * DesignSurface and DesignSurfaceManager with all the documented in MSDN services offered. * ComponentDesigner, ControlDesigner, ParentControlDesigner, ScrollableControlDesigner, DocumentDesigner, SplitContainerDesigner * System.ComponentModel.Design.Serialization namespace ### MonoDevelop Addin The few implementation approaches were broken in different ways. The initial approach was to use a RemoteProcessObject to host the visual part of the designing process (just the UI) as provided by MonoDevelop and as utilized by the AspNetAddin. But my design involved design surface initialization (not loading) on the non-remote part and passing non-serializable objects to the remote part, which ended up being impossible as one can imagine. The next approach was to drop remoting and run the editor process on a separate thread with it’s own GTK+ and MWF loops. It took me two days to figure out that I can’t have two gtk loops in one process, while wondering what is going badly wrong with the code. The last approach utilizes remoting again, but the surface initialization and services logic will be completely redesigned. Unfortunately I stumbled upon DnD issues in MWF-in-GTK in MWF, which is not able to handle the specifics imposed by the XEMBED protocol. Also the last time I tried running the MWF-in-GTK code it wasn’t working. I finally gave up on wasting more time on that, so the monodevelop designer addin code in SVN is obsolete and deprecated. ### MWF Designer [[Image:software/mwf-designer.png|center]] I have designed and developed a small standalone frontend to the Design-Time code. I have followed the KISS principle and I am quite happy with the resulting code – it’s simple and works. It deals in terms of a Workspace with loaded Documents. The Workspace has a list of References (to e.g assemblies with custom components). A Document is a unit of a codebehind file, user code file and in the future (once resources serialization and deserialization is implemented) a resource file. Currently the designer: * Can load (in tabs) souce code in .Net 2.0 form – partial classes with a .Designer codebehind file. It is also able to save changes back to source code. * Has a PropertyGrid, a simple Toolbox and components dropdown list. * Maintains a user-modifiable References list for the user to reference assemblies with custom components and other. ### Tasks Left An up-to-date list can be found on [http://monodt.ivanz.com/wiki/Tasks][7]{#jmj1}
* DesignerOptions, WindowsFormsDesignerOptionService * Extender Providers – http://msdn2.microsoft.com/en-us/library/ms171835.aspx * IDesignerHost.Activate is invoked after the root component is added to the host. This is just my guess. It has to be further investigated when, where and by what should that be invoked. * Implement MenuCommandService : IMenuCommandService, MenuCommands, MenuCommand * LicenseContext * Transactions are not created – must be fixed before implementing the UndoEngine Serialization * Resources serialization and deserialization * ControlCodeDomSerializer – Resume/SuspendLayout * ContainerCodeDomSerializer – to serialize the container for the components and its disposing * UndoEngine, ComponentSerializationService, CodeDomComponentSerializationService, CodeDomDesignerLoader.IDesignerSerializationService * No creation expression is serialized for nested components by the ComponentCodeDomSerializer. I can’t think of a use case where this would be required. * InheritanceService, InheritanceAttribute – what are those about? * AmbientAttribute – no checks for that currently. * Make use of the IUIService for reporting errors
Designer Frontend
* Doesn’t support multi-component selection, because it only handles the ISelectionService.PrimarySelection and not the GetSelectedComponents. * Implement New -> * * Implement Close Document * Implement IUIService for user-friendly error reporting by the surface * Implement Undo/Redo – make use of the UndoEngine * Implement Copy, Paste, Cut, Delete – use the MenuCommandService * Implement Format -> *
* Implement EventsTab and add EventsTab support in MWF’s PropertyGrid * Update TypeDescriptor to .Net 2,0 * Implement WS\_EX\_TRANSPARENT for MWF’s X11 backend – [http://bugzilla.ximian.com/show_bug.cgi?id=81135][8]{#hz2.} * A lot of PropertyGrid Editors are missing in Mono and the PropertyGrid “dies” easily due to the exceptions thrown Designers * System.Windows.Forms.Behavior namespace to replace IUISelectionService. Requires transparency (WS\_EX\_TRANSPARENT), which is not yet supported by the MWF X11 backend. * Implement ComponentTray * Make use of the IUIService for reporting errors * Menu has a designer in a Visual Studio assembly (Microsoft.VisualStudio.Windows.Forms.MenuDesigner) – fix that. * Implement the stack of specialized WinForms designers * AxHostDesigner * BindingNavigatorDesigner * BindingSourceDesigner * ButtonBaseDesigner * ComboBoxDesigner * DataGridDesigner * DataGridViewColumnDesigner * DataGridViewComboBoxColumnDesigner * DataGridViewDesigner * DateTimePickerDesigner * FlowLayoutPanelDesigner * FolderBrowserDialogDesigner * GroupBoxDesigner * ImageListDesigner * LabelDesigner * ListBoxDesigner * ListViewDesigner * MaskedTextBoxDesigner * MonthCalendarDesigner * NotifyIconDesigner * OpenFileDialogDesigner * PanelDesigner * PictureBoxDesigner * PrintDialogDesigner * PropertyGridDesigner * RadioButtonDesigner * SaveFileDialogDesigner * ScrollableControlDesigner * SplitContainerDesigner * SplitterDesigner * SplitterPanelDesigner * StatusBarDesigner * TabControlDesigner * TableLayoutPanelDesigner * TabPageDesigner * TextBoxBaseDesigner * TextBoxDesigner * ToolBarButtonDesigner * ToolBarDesigner * ToolStripContainerDesigner * ToolStripContentPanelDesigner * ToolStripDesigner * ToolStripDropDownDesigner * ToolStripItemDesigner * ToolStripMenuItemDesigner * ToolStripPanelDesigner * TrackBarDesigner * TreeViewDesigner * UpDownBaseDesigner * WebBrowserBaseDesigner [1]: http://monodt.ivanz.com/ "http://monodt.ivanz.com" [2]: http://svn.ivanz.com/monodt "http://svn.ivanz.com/monodt" [3]: http://slickedit.com/ "SlickEdit" [4]: http://nunit.sourceforge.net/ "NUnit" [5]: http://www.opensuse.org/ [6]: http://virtualbox.org/ "VirtualBox" [7]: http://monodt.ivanz.com/wiki/Tasks "http://monodt.ivanz.com/wiki/Tasks" [8]: http://bugzilla.ximian.com/show_bug.cgi?id=81135 "http://bugzilla.ximian.com/show_bug.cgi?id=81135"

Blog Logo

Ivan Zlatev



Ivan's Brain Dump

Back to Overview