[Mono-list] Serialization Compatability and workaround question
Neil Cawse
neilc@geotab.ca
Thu, 27 Feb 2003 23:11:56 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0024_01C2DEB5.A0437EE0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Ive got a question for all you gurus..
I am writing some stuff as a replacement for MS System.Windows.Forms.
If you put a picturebox on a form, the image object is serialized into
the resources of the form. When the form loads, the ResourceManager
deserializes the image (could be an image per locale).
private void InitializeComponent() {
System.Resources.ResourceManager resources = new
System.Resources.ResourceManager(typeof(Form3));
this.pictureBox1.Image =
((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
.
}
If I create a replacement for the Image object - how can I make sure
that it will correctly deserialize from a form that was created using
.NET?
ie How do I deserialize to my image object from the ms image object.
Without digging into the classes, does my Image object need to have the
exact same members both private and public? Is it just variables I need
to worry about (because that's all that will get serialized)? Must the
order or the names be the same?
I will certainly be doing a different implementation to Microsofts -
with additional variables - If I mark these not to be serialized?
Am I missing some neat way of dealing with this?
------=_NextPart_000_0024_01C2DEB5.A0437EE0
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
<html>
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 10 (filtered)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{font-family:Tahoma;
color:windowtext;
font-weight:normal;
font-style:normal;
text-decoration:none none;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>Ive got a question for all you =
gurus..</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>I am writing some stuff as a replacement for MS =
System.Windows.Forms.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>If you put a picturebox on a form, the image object =
is
serialized into the resources of the form. When the form loads, the =
ResourceManager
deserializes the image (could be an image per locale).</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>private void InitializeComponent() =
{</span></font></p>
<p class=3DMsoNormal style=3D'text-indent:36.0pt'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>System.Resources.ResourceMa=
nager
resources =3D new =
System.Resources.ResourceManager(typeof(Form3));</span></font></p>
<p class=3DMsoNormal style=3D'text-indent:36.0pt'><font size=3D2 =
face=3DTahoma><span
style=3D'font-size:10.0pt;font-family:Tahoma'>this.pictureBox1.Image =3D =
((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"=
)));</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>…</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>}</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>If I create a replacement for the Image object =
– how can
I make sure that it will correctly deserialize from a form that was =
created
using .NET?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>ie How do I deserialize to my image object from the =
ms
image object.</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>Without digging into the classes, does my Image =
object need
to have the exact same members both private and public? Is it just =
variables I need
to worry about (because that’s all that will get serialized)? Must =
the
order or the names be the same?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>I will certainly be doing a different implementation =
to Microsofts
– with additional variables – If I mark these not to be =
serialized?</span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'> </span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DTahoma><span =
style=3D'font-size:10.0pt;
font-family:Tahoma'>Am I missing some neat way of dealing with =
this?</span></font></p>
</div>
</body>
</html>
------=_NextPart_000_0024_01C2DEB5.A0437EE0--