Exemple #1
0
 public static void save(Object ob, String filename)
 {
     //this creates an XML writer, which will be used to serialize an object to XML
     XmlTextWriter writer = new XmlTextWriter(filename, null);
     //this creates the WOX writer
     ObjectWriter woxWriter = new SimpleWriter();
     //writes the object to XML
     woxWriter.write(ob, writer);
     writer.Close();
     Console.Out.WriteLine("Saved object to " + filename);
 }
Exemple #2
0
        public static void save(Object ob, String filename)
        {
            //this creates an XML writer, which will be used to serialize an object to XML
            XmlTextWriter writer = new XmlTextWriter(filename, null);
            //this creates the WOX writer
            ObjectWriter woxWriter = new SimpleWriter();

            //writes the object to XML
            woxWriter.write(ob, writer);
            writer.Close();
            Console.Out.WriteLine("Saved object to " + filename);
        }