static void Main(string[] args) { Console.WriteLine("Hello World!"); Common common = new Common() { B = 30 }; NodeReflection reflection = new NodeReflection(); Node node = reflection.GetReflectNode(common); Debug.WriteLine(node.ToString()); Common result = reflection.CreateObject <Common>(node); Debug.WriteLine("value {0} {1} {2}", result.A, result.B, result.C); string xml = "<?xml version=\"1.0\"?><name>value</name>"; XmlPacker packer = new XmlPacker(); packer.IgnoreWhitespace = true; packer.Parse(node); string packed = packer.ToString(); Debug.WriteLine(packed); }
public void XmlPack() { XmlPacker xmlPacker = new XmlPacker(); xmlPacker.IgnoreWhitespace = true; xmlPacker.Encoding = null; xmlPacker.Parse(document); string result = xmlPacker.ToString(); Assert.AreEqual(result, xml); }