コード例 #1
0
        private void SerializeVertices(StreamWriter outfile)
        {
            foreach (var vertex in _graph.Vertices)
            {
                var inDegree  = _graph.InEdges(vertex).Count();
                var outDegree = _graph.OutEdges(vertex).Count();

                outfile.WriteLine(String.Format(CultureInfo.InvariantCulture, "    <node id=\"n{0}\" parse.indegree=\"{1}\" parse.outdegree=\"{2}\">",
                                                vertex.VertexId, inDegree, outDegree));
                SerializePropertyValues(outfile, vertex);
                outfile.WriteLine("    </node>");
            }
        }