Exemplo n.º 1
0
        public void WriteGxlAdjacencyGraph()
        {
            XmlTextWriter writer = new XmlTextWriter(Console.Out);

            writer.Formatting = Formatting.Indented;

            GxlGraphSerializer ser = new GxlGraphSerializer();

            ser.Serialize(writer, Graph);
        }
Exemplo n.º 2
0
        public void ReadWriteGxlAdjacencyGraph()
        {
            StringWriter  sw     = new StringWriter();
            XmlTextWriter writer = new XmlTextWriter(sw);

            writer.Formatting = Formatting.Indented;

            GxlGraphSerializer ser = new GxlGraphSerializer();

            ser.Serialize(writer, Graph);

            XmlAssert.XmlValid(sw.ToString());

            StringReader  sr     = new StringReader(sw.ToString());
            XmlTextReader reader = new XmlTextReader(sr);
            ISerializableVertexAndEdgeListGraph g = ser.Deserialize(reader);

            CheckGraphEqual(Graph, g);
        }