all groups > dotnet windows forms designtime > august 2005 >
You're in the

dotnet windows forms designtime

group:

Using CodeDom and IDesignerSerializationManager


Using CodeDom and IDesignerSerializationManager Graham Allwood
8/4/2005 10:29:59 AM
dotnet windows forms designtime:
Hi,

I have been attempting to serialize a form to Xml using .NET 2.0. I have
successfully created my custom forms designer and I have implemented a
DesignerLoader (derived from BasicDesignerLoader). However, when it came to
serializing a form that contained a TableLayouyPanel I found that I had
moved in to a whole new set of problems, i.e. when deserializing the xml
(instantiate the class from the xml) I found I needed the row and column
position of the tables child controls. Something which I could seem to find
easily from my serialized xml.

Because of all this I though I would use the CodeDom instead. After all, I
only need to persist the description of a form and be able to instantiate it
a run time. I decided to use the CodeDom as all the windows forms controls
seem to have a DesignerSerializer that should provide me with the correct
information.

So, finally, the question I have is quite simple: Am I best deriving from
the CodeDomDesignerLoader and does anyone know how to use / derive from this
class, i.e. how to implement the abstract methods?

Kind regards

Graham

Re: Using CodeDom and IDesignerSerializationManager Graham Allwood
8/4/2005 9:33:43 PM
Well, I have got a little further now. It seems quite easy to derive from
the CodeDomDesignerSerializer as there are only about 4 methods that need to
be overridden. Having said that it still isn't working. The problem I have
is that one of the methods of this class, Parse(), needs to return a
CodeCompileUnit of the class to design. However, no matter what I do I can't
seem to get a simple CodeCompileUnit together that represents a very simple
form derived class.

Graham

[quoted text, click to view]

RE: Using CodeDom and IDesignerSerializationManager David Whitchurch-Bennett
9/20/2005 2:52:01 AM
Hi Graham,

Would you mind helping me, by explaining how you even got this far. I would
like to be able to save the layout of a design surface, and load it later. I
don't really care on the format! How did you link the BasicDesignerLoader to
the design surface, and how does it perform the flush etc?

Thanks,

David.

[quoted text, click to view]
AddThis Social Bookmark Button