Table of Contents

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

writer TextWriter

The 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

bool

EdgeAdorner

Gets or sets the adorner to use for adorning the edges in the final output.

public IDotEdgeAdorner? EdgeAdorner { get; set; }

Property Value

IDotEdgeAdorner

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

bool

NodeAdorner

Gets or sets the adorner to use for adorning the nodes in the final output.

public IDotNodeAdorner? NodeAdorner { get; set; }

Property Value

IDotNodeAdorner

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

INodeIdentifier

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

bool

SubGraphAdorner

Gets or sets the adorner to use for adorning the sub graphs in the final output.

public IDotSubGraphAdorner? SubGraphAdorner { get; set; }

Property Value

IDotSubGraphAdorner

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

IndentedTextWriter

Methods

NeedsEscaping(string)

Determines whether an identifier requires escaping.

protected static bool NeedsEscaping(string text)

Parameters

text string

The identifier to test.

Returns

bool

True if the identifier needs escaping, false otherwise.

Write(IGraph)

Writes a graph to the character stream.

public void Write(IGraph graph)

Parameters

graph IGraph

The graph to write.

WriteEdge(IEdge)

Appends an edge to the output stream.

protected virtual void WriteEdge(IEdge edge)

Parameters

edge IEdge

The edge to append.

WriteEscapedCharacter(char)

Appends a single character to the output stream, and escapes it when necessary.

protected void WriteEscapedCharacter(char c)

Parameters

c char

The 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

graphType string
graphName string

WriteIdentifier(string)

Appends a single identifier to the output stream.

protected void WriteIdentifier(string text)

Parameters

text string

The identifier to write.

WriteNode(INode)

Appends a single node definition to the output stream.

protected virtual void WriteNode(INode node)

Parameters

node INode

The node to append.

WriteSemicolon()

Appends a semicolon to the output stream, depending on the value of IncludeSemicolons.

protected void WriteSemicolon()