Exemplo n.º 1
0
        /// <summary>
        /// Appends a single node definition to the output stream.
        /// </summary>
        /// <param name="node">The node to append.</param>
        protected virtual void WriteNode(INode node)
        {
            long id = NodeIdentifier.GetIdentifier(node);

            WriteIdentifier(id.ToString());

            if (NodeAdorner != null)
            {
                WriteEntityAttributes(NodeAdorner.GetNodeAttributes(node, id));
            }

            WriteSemicolon();
            Writer.WriteLine();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Appends an edge to the output stream.
        /// </summary>
        /// <param name="edge">The edge to append.</param>
        protected virtual void WriteEdge(IEdge edge)
        {
            long sourceId = NodeIdentifier.GetIdentifier(edge.Origin);
            long targetId = NodeIdentifier.GetIdentifier(edge.Target);

            WriteIdentifier(sourceId.ToString());
            Writer.Write(" -> ");
            WriteIdentifier(targetId.ToString());

            if (EdgeAdorner != null)
            {
                WriteEntityAttributes(EdgeAdorner.GetEdgeAttributes(edge, sourceId, targetId));
            }

            WriteSemicolon();
            Writer.WriteLine();
        }