I am working on a form designer. I have defined my own controls to list into
a IToolBoxService, and the PropertyGrid, but I am having a difficult time
Serializing a Windows Form to XML.

Bascially, I want to take the form & Properties, and Controls within the
form & Properties and place them into an XML file for later use.

The ResXResourceWriter is fairly straight forward to use, but as a resx
files, it doesn't store all of the property information about the form.
System.Windows.Forms.Form is not serializable, so what options do I have to
serialize this stuff to xml?

Any examples, or help is greatly appreciated.

Re: Serializing System.Windows.Forms by Alexander

Alexander
Sat Mar 12 01:28:53 CST 2005

Lucas,

Maybe it's a completely insane suggestion, but have a look at
www.myxaml.com. Start here: http://www.myxaml.com/forum/?f=12&m=544&g=584

HTH,
Alexander

"Lucas Curley" <Lucas Curley@discussions.microsoft.com> wrote in message
news:718A2723-6F4C-4476-BBD8-ADE3651E447F@microsoft.com...
>I am working on a form designer. I have defined my own controls to list
>into
> a IToolBoxService, and the PropertyGrid, but I am having a difficult time
> Serializing a Windows Form to XML.
>
> Bascially, I want to take the form & Properties, and Controls within the
> form & Properties and place them into an XML file for later use.
>
> The ResXResourceWriter is fairly straight forward to use, but as a resx
> files, it doesn't store all of the property information about the form.
> System.Windows.Forms.Form is not serializable, so what options do I have
> to
> serialize this stuff to xml?
>
> Any examples, or help is greatly appreciated.



Re: Serializing System.Windows.Forms by LucasCurley

LucasCurley
Sat Mar 12 08:09:03 CST 2005

Yea, I saw that, but I'm assuming since there isn't a ton of information out
there, that I need to write my own serialization for a form, and the controls
it contains. It isn't that difficult really, but I would have thought that
this was built into the framework.

Thanks,
LJC

"Alexander Shirshov" wrote:

> Lucas,
>
> Maybe it's a completely insane suggestion, but have a look at
> www.myxaml.com. Start here: http://www.myxaml.com/forum/?f=12&m=544&g=584
>
> HTH,
> Alexander
>
> "Lucas Curley" <Lucas Curley@discussions.microsoft.com> wrote in message
> news:718A2723-6F4C-4476-BBD8-ADE3651E447F@microsoft.com...
> >I am working on a form designer. I have defined my own controls to list
> >into
> > a IToolBoxService, and the PropertyGrid, but I am having a difficult time
> > Serializing a Windows Form to XML.
> >
> > Bascially, I want to take the form & Properties, and Controls within the
> > form & Properties and place them into an XML file for later use.
> >
> > The ResXResourceWriter is fairly straight forward to use, but as a resx
> > files, it doesn't store all of the property information about the form.
> > System.Windows.Forms.Form is not serializable, so what options do I have
> > to
> > serialize this stuff to xml?
> >
> > Any examples, or help is greatly appreciated.
>
>
>

Re: Serializing System.Windows.Forms by Tim

Tim
Sat Mar 12 08:22:09 CST 2005

Alexander already pointed you to XAML. Another option here is to use WFML.
This is not exactly the ability to serialize a Form as it exists today,
rather it's another idea of how to store Form content in a XML style.
http://windowsforms.net/articles/wfml.aspx

--
Tim Wilson
.Net Compact Framework MVP

"Lucas Curley" <Lucas Curley@discussions.microsoft.com> wrote in message
news:718A2723-6F4C-4476-BBD8-ADE3651E447F@microsoft.com...
> I am working on a form designer. I have defined my own controls to list
into
> a IToolBoxService, and the PropertyGrid, but I am having a difficult time
> Serializing a Windows Form to XML.
>
> Bascially, I want to take the form & Properties, and Controls within the
> form & Properties and place them into an XML file for later use.
>
> The ResXResourceWriter is fairly straight forward to use, but as a resx
> files, it doesn't store all of the property information about the form.
> System.Windows.Forms.Form is not serializable, so what options do I have
to
> serialize this stuff to xml?
>
> Any examples, or help is greatly appreciated.



Re: Serializing System.Windows.Forms by Alexander

Alexander
Sat Mar 12 12:16:43 CST 2005

Lucas,

Just popped up in my memory:
http://www.divil.co.uk/net/articles/designers/hosting.asp. It might be
useful to you, but I'm quite sure you've read it already.

Few months ago I spent several hours on myxaml web site and it appeared as
the place to look for combined wisdom on XML (de)serialization of CLR object
graphs. There were thoughtful discussions on the subject in Marc's articles
and in the forums. I can't think of better resource and trust me, I surf a
lot: I'm unemployed for many months. :-)

Out of curiousity, why are you writing your own form designer? Is it
something domain specific?

Alexander

"Lucas Curley" <LucasCurley@discussions.microsoft.com> wrote in message
news:C4DDA39F-7D85-4832-9ECB-AD9CBF299855@microsoft.com...
> Yea, I saw that, but I'm assuming since there isn't a ton of information
> out
> there, that I need to write my own serialization for a form, and the
> controls
> it contains. It isn't that difficult really, but I would have thought
> that
> this was built into the framework.
>
> Thanks,
> LJC
>
> "Alexander Shirshov" wrote:
>
>> Lucas,
>>
>> Maybe it's a completely insane suggestion, but have a look at
>> www.myxaml.com. Start here: http://www.myxaml.com/forum/?f=12&m=544&g=584
>>
>> HTH,
>> Alexander
>>
>> "Lucas Curley" <Lucas Curley@discussions.microsoft.com> wrote in message
>> news:718A2723-6F4C-4476-BBD8-ADE3651E447F@microsoft.com...
>> >I am working on a form designer. I have defined my own controls to list
>> >into
>> > a IToolBoxService, and the PropertyGrid, but I am having a difficult
>> > time
>> > Serializing a Windows Form to XML.
>> >
>> > Bascially, I want to take the form & Properties, and Controls within
>> > the
>> > form & Properties and place them into an XML file for later use.
>> >
>> > The ResXResourceWriter is fairly straight forward to use, but as a resx
>> > files, it doesn't store all of the property information about the form.
>> > System.Windows.Forms.Form is not serializable, so what options do I
>> > have
>> > to
>> > serialize this stuff to xml?
>> >
>> > Any examples, or help is greatly appreciated.
>>
>>
>>



Re: Serializing System.Windows.Forms by Bob

Bob
Sat Mar 12 12:37:55 CST 2005

Windows Forms objects are a pain to serialize so most often this task is
accomplished using an implementation of the Memento Pattern.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Lucas Curley" <Lucas Curley@discussions.microsoft.com> wrote in message
news:718A2723-6F4C-4476-BBD8-ADE3651E447F@microsoft.com...
>I am working on a form designer. I have defined my own controls to list
>into
> a IToolBoxService, and the PropertyGrid, but I am having a difficult time
> Serializing a Windows Form to XML.
>
> Bascially, I want to take the form & Properties, and Controls within the
> form & Properties and place them into an XML file for later use.
>
> The ResXResourceWriter is fairly straight forward to use, but as a resx
> files, it doesn't store all of the property information about the form.
> System.Windows.Forms.Form is not serializable, so what options do I have
> to
> serialize this stuff to xml?
>
> Any examples, or help is greatly appreciated.