T
Trecius
Hello, Newsgroupians:
I am trying to serialize an instantiated object using XmlSerializer. I
would like to serialize the object to an XML file; however, I'd like it to be
in a subcategory in the XML file, for I'd like to save other settings in the
XML file. Is it possible to do this using XmlSerializer?
The class, or type, of my object I'd like to serialize is "Calculator."
Here's an example of my XML file.
<?xml version="1.0"?>
<CalcLibrary>
<Calculator xmlns:xsd="GAppCalculator">
<Name>GEXI</Name>
<Buttons>42</Buttons>
...
</Calculator>
<Calculator xmlns:xsd="GAppCalculator">
<Name>KEK</Name>
<Buttons>50</Buttons>
...
</Calculator>
</CalcLibrary>
<SomeOtherSettingsIWantToSave>
...
</SomeOtherSettingsIWantToSave>
Here's my second question really quickly. Suppose I have many calculators
to store. How can I deserialize a specific calculator? I've seen
documentation that deserializes an object, but the examples I've seen they
are only serializing ONE object and then deserializing that same object. How
can I specify that I would like to deserialize the calculator with the name
"KEK" and not deserialize all the other calculators in the XML file?
Thank you, all, for your help.
Trecius
I am trying to serialize an instantiated object using XmlSerializer. I
would like to serialize the object to an XML file; however, I'd like it to be
in a subcategory in the XML file, for I'd like to save other settings in the
XML file. Is it possible to do this using XmlSerializer?
The class, or type, of my object I'd like to serialize is "Calculator."
Here's an example of my XML file.
<?xml version="1.0"?>
<CalcLibrary>
<Calculator xmlns:xsd="GAppCalculator">
<Name>GEXI</Name>
<Buttons>42</Buttons>
...
</Calculator>
<Calculator xmlns:xsd="GAppCalculator">
<Name>KEK</Name>
<Buttons>50</Buttons>
...
</Calculator>
</CalcLibrary>
<SomeOtherSettingsIWantToSave>
...
</SomeOtherSettingsIWantToSave>
Here's my second question really quickly. Suppose I have many calculators
to store. How can I deserialize a specific calculator? I've seen
documentation that deserializes an object, but the examples I've seen they
are only serializing ONE object and then deserializing that same object. How
can I specify that I would like to deserialize the calculator with the name
"KEK" and not deserialize all the other calculators in the XML file?
Thank you, all, for your help.
Trecius