예제 #1
0
        /// <summary>
        ///     Write the data in a Graph to a GML OutputStream.
        /// </summary>
        /// <param name="graph">the Graph to pull the data from</param>
        /// <param name="filename">the GML file to write the Graph data to</param>
        public static void OutputGraph(IGraph graph, string filename)
        {
            if (graph == null)
            {
                throw new ArgumentNullException(nameof(graph));
            }
            if (string.IsNullOrWhiteSpace(filename))
            {
                throw new ArgumentNullException(nameof(filename));
            }

            var writer = new GmlWriter(graph);

            writer.OutputGraph(filename);
        }
예제 #2
0
        /// <summary>
        ///     Write the data in a Graph to a GML OutputStream.
        /// </summary>
        /// <param name="graph">the Graph to pull the data from</param>
        /// <param name="graphMlOutputStream">the GML OutputStream to write the Graph data to</param>
        public static void OutputGraph(IGraph graph, Stream graphMlOutputStream)
        {
            if (graph == null)
            {
                throw new ArgumentNullException(nameof(graph));
            }
            if (graphMlOutputStream == null)
            {
                throw new ArgumentNullException(nameof(graphMlOutputStream));
            }

            var writer = new GmlWriter(graph);

            writer.OutputGraph(graphMlOutputStream);
        }