Hi everybody,
give me please advice.I have proposed a class for serialization in namespace "Xml_form_application"and it looks this way:
namespace Xml_form_application
{
public class RecordStore
{
public MyObject MyObjectProperty;
}
public class MyObject
{
public string item = "thing";
}
}
//Class form2 with button2 to calling this action
private void button2_Click(object sender, EventArgs e)
{
RecordStore pd = new RecordStore();
TextWriter tr = new StreamWriter("C:/Users/admin/Dokumenty/Visual Studio 2010/Projects/Xml_form_application/Xml_form_application/Cvicna.xml");
XmlSerializer sr = new XmlSerializer(typeof(RecordStore));
sr.Serialize(tr, pd);
tr.Close();
}
In input there's this xml code:
<?xml version="1.0" encoding="utf-8"?>
<RecordStore xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
I wanna to have this input with xml code (How way I can attain this result):
<RecordStore>
<MyObjectProperty>
<item>thing</item>
</MyObjectProperty>
</RecordStore>