Exemple #1
0
 public override Object Deserialize(StreamReader reader)
 {
     Example example = new Example();
     var ser = new DataContractSerializer(typeof(Example));
     using (XmlReader xw = XmlReader.Create(reader))
     {
         return ser.ReadObject(xw, true);
     }
 }
Exemple #2
0
        static void Main(string[] Args)
        {
            Example myExample = new Example();

            StreamWriter writer = new StreamWriter("../../a.xml");

            myExample.Serialize(writer);

            SerializationTable table = new SerializationTable();

            table.m_list.Add(new Example());
            table.m_list.Add(new Example());
            table.m_list.Add(new Example());
            table.m_list.Add(new Example());
            table.m_list.Add(new Example());
            table.m_list.Add(new Example());

            table.Serialize();
        }