Пример #1
0
 /// <summary>
 /// Add an directed edge from a node with the given <paramref name="fromIdentifier"/> to a node
 /// with the given <paramref name="toIdentifier"/>.
 /// </summary>
 /// <param name="writer">The writer to which the edge is added.</param>
 /// <param name="fromIdentifier">The identifier of the first node of the edge.</param>
 /// <param name="toIdentifier">The identifier of the second node of the edge.</param>
 /// <param name="dotAttributes">An array of <see cref="T:IEdgeDotAttribute"/> instances
 /// that alter the way the edge is displayed.</param>
 /// <remarks>
 /// <para>If one of the identifiers (<paramref name="fromIdentifier"/> or <paramref name="toIdentifier"/>), the edge is not added.</para>
 /// <para>If there are no nodes defined with the given identifier, additional nodes will be added to the graph,
 /// this is the behavior of GraphViz DOT graphs.</para>
 /// <para>If the given list of attributes is not effective, no attributes are added to the node.</para>
 /// <para>If the given <paramref name="writer"/> is not effective, nothing happens.</para>
 /// </remarks>
 public static void AddDirectedEdge(this IDotTextWriter writer, string fromIdentifier, string toIdentifier, params IEdgeDotAttribute[] dotAttributes)
 {
     if (writer != null)
     {
         writer.AddDirectedEdge(fromIdentifier, toIdentifier, (IEnumerable <IEdgeDotAttribute>)dotAttributes);
     }
 }
Пример #2
0
 /// <summary>
 /// Add a node to the current graph.
 /// </summary>
 /// <param name="writer">The writer to which the node is added.</param>
 /// <param name="identifier">The identifier of the current node.</param>
 /// <param name="dotAttributes">A <see cref="T:IEnumerable`1"/> of optional attributes to be added to the
 /// node that will be added.</param>
 /// <remarks>
 /// <para>The identifier must be effective for the operation to take place.</para>
 /// <para>If the given list of attributes is not effective, no attributes are added to the node.</para>
 /// <para>If the given <paramref name="writer"/> is not effective, nothing happens.</para>
 /// </remarks>
 public static void AddNode(this IDotTextWriter writer, string identifier, params INodeDotAttribute[] dotAttributes)
 {
     if (writer != null)
     {
         writer.AddNode(identifier, (IEnumerable <INodeDotAttribute>)dotAttributes);
     }
 }