Class DotWriter
- Namespace
- Echo.Graphing.Serialization.Dot
- Assembly
- Echo.dll
Provides a mechanism for writing graphs to a character stream using the dot file format.
public class DotWriter
- Inheritance
-
DotWriter
- Inherited Members
Constructors
DotWriter(TextWriter)
Creates a new dot writer.
public DotWriter(TextWriter writer)
Parameters
writerTextWriterThe writer responsible for writing the output.
Properties
DirectedGraph
Gets or sets a value indicating the resulting graph should be rendered as a directed graph or an undirected graph.
public bool DirectedGraph { get; set; }
Property Value
EdgeAdorner
Gets or sets the adorner to use for adorning the edges in the final output.
public IDotEdgeAdorner? EdgeAdorner { get; set; }
Property Value
Remarks
When this property is set to null, no adornments will be added.
IncludeSemicolons
Gets or sets a value indicating whether statements in the output file should be separated by semicolons.
public bool IncludeSemicolons { get; set; }
Property Value
NodeAdorner
Gets or sets the adorner to use for adorning the nodes in the final output.
public IDotNodeAdorner? NodeAdorner { get; set; }
Property Value
Remarks
When this property is set to null, no adornments will be added.
NodeIdentifier
Gets or sets the object responsible for assigning unique identifiers to nodes in a graph.
public INodeIdentifier NodeIdentifier { get; set; }
Property Value
SeparateNodesAndEdges
Gets or sets a value indicating whether nodes in the output file should be explicitly defined before the edges are defined.
public bool SeparateNodesAndEdges { get; set; }
Property Value
SubGraphAdorner
Gets or sets the adorner to use for adorning the sub graphs in the final output.
public IDotSubGraphAdorner? SubGraphAdorner { get; set; }
Property Value
Remarks
When this property is set to null, no adornments will be added.
Writer
Gets the writer that is used to write textual data to the output stream.
protected IndentedTextWriter Writer { get; }
Property Value
Methods
NeedsEscaping(string)
Determines whether an identifier requires escaping.
protected static bool NeedsEscaping(string text)
Parameters
textstringThe identifier to test.
Returns
- bool
Trueif the identifier needs escaping,falseotherwise.
Write(IGraph)
Writes a graph to the character stream.
public void Write(IGraph graph)
Parameters
graphIGraphThe graph to write.
WriteEdge(IEdge)
Appends an edge to the output stream.
protected virtual void WriteEdge(IEdge edge)
Parameters
edgeIEdgeThe edge to append.
WriteEscapedCharacter(char)
Appends a single character to the output stream, and escapes it when necessary.
protected void WriteEscapedCharacter(char c)
Parameters
ccharThe character to write.
WriteHeader(string, string?)
Appends the header of a new graph to the output stream.
protected virtual void WriteHeader(string graphType, string? graphName)
Parameters
WriteIdentifier(string)
Appends a single identifier to the output stream.
protected void WriteIdentifier(string text)
Parameters
textstringThe identifier to write.
WriteNode(INode)
Appends a single node definition to the output stream.
protected virtual void WriteNode(INode node)
Parameters
nodeINodeThe node to append.
WriteSemicolon()
Appends a semicolon to the output stream, depending on the value of IncludeSemicolons.
protected void WriteSemicolon()