コード例 #1
0
ファイル: GraphVizWriter.cs プロジェクト: orloffm/prigitsk
        /// <summary>
        ///     Pops a graph handle from stack, no checks performed.
        /// </summary>
        private void EndGraphInternal()
        {
            GraphHandle h = _subGraphs.Pop();

            h.MarkAsUsed();
            Line("}");
        }
コード例 #2
0
ファイル: GraphVizWriter.cs プロジェクト: orloffm/prigitsk
        public IGraphHandle StartGraph(GraphMode graphMode, bool strict)
        {
            _graphMode = graphMode;
            if (_subGraphs.Count != 0)
            {
                throw new InvalidOperationException();
            }

            string line = "";

            if (strict)
            {
                line += "strict ";
            }

            line += graphMode == GraphMode.Graph ? "graph" : "digraph";
            line += " \"\" {";

            Line(line);

            GraphHandle g = new GraphHandle(this);

            _subGraphs.Push(g);
            return(g);
        }
コード例 #3
0
ファイル: GraphVizWriter.cs プロジェクト: orloffm/prigitsk
        /// <summary>
        ///     Ends graph or subgraph when called by handle disposal.
        /// </summary>
        internal void EndGraphFromHandle(GraphHandle handle)
        {
            if (!ReferenceEquals(_subGraphs.Peek(), handle))
            {
                throw new InvalidOperationException();
            }

            EndGraphInternal();
        }
コード例 #4
0
ファイル: GraphVizWriter.cs プロジェクト: orloffm/prigitsk
        public IGraphHandle StartSubGraph()
        {
            if (_subGraphs.Count == 0)
            {
                throw new InvalidOperationException();
            }

            Line("subgraph {");

            GraphHandle g = new GraphHandle(this);

            _subGraphs.Push(g);
            return(g);
        }