Пример #1
0
        internal DotCodeGenContext Reset(DotGraphType graphType)
        {
            TextComposer.Clear();

            GraphType = graphType;

            return(this);
        }
Пример #2
0
        /// <summary>
        /// Add a graph to the file with a given name.
        /// </summary>
        /// <param name="type">The type of the graph to be added, optional, by default <see cref="DotGraphType.DirectedGraph"/>.</param>
        /// <param name="name">The name of the graph, optional, by default not effective.</param>
        public void AddGraph(DotGraphType type = DotGraphType.DirectedGraph, string name = null)
        {
            //TODO: cleanup
            switch (type)
            {
            case DotGraphType.DirectedGraph:
                this.Write(DotVisualUtils.DirectedGraphKeyword);
                break;

            case DotGraphType.Graph:
                this.Write(DotVisualUtils.GraphKeyword);
                break;
            }
            this.Write(DotVisualUtils.TokenSeparator);
            this.WriteLine(DotVisualUtils.ScopeOpen);
            this.Indent++;
        }
Пример #3
0
 internal DotCodeGenContext(DotGraphType graphType)
 {
     TextComposer = new LinearComposer();
     GraphType    = graphType;
 }
Пример #4
0
 /// <summary>
 /// Add a graph to the file with a given name.
 /// </summary>
 /// <param name="type">The type of the graph to be added, optional, by default <see cref="DotGraphType.DirectedGraph"/>.</param>
 /// <param name="name">The name of the graph, optional, by default not effective.</param>
 public void AddGraph(DotGraphType type = DotGraphType.DirectedGraph, string name = null)
 {
     //TODO: cleanup
     switch (type) {
     case DotGraphType.DirectedGraph:
         this.Write (DotVisualUtils.DirectedGraphKeyword);
         break;
     case DotGraphType.Graph:
         this.Write (DotVisualUtils.GraphKeyword);
         break;
     }
     this.Write (DotVisualUtils.TokenSeparator);
     this.WriteLine (DotVisualUtils.ScopeOpen);
     this.Indent++;
 }
Пример #5
0
 protected DotGraph(DotGraphType graphType, string graphName)
 {
     GraphType = graphType;
     GraphName = graphName;
 }