Example #1
0
 /// <summary>
 /// Сводит узлы
 /// </summary>
 /// <param name="otherNode"></param>
 public void Merge(GraphElementBase otherNode)
 {
     foreach (var a in otherNode.Attributes)
     {
         Attributes[a.Key] = a.Value;
     }
 }
Example #2
0
 private void WriteInlineAttributes(GraphElementBase e)
 {
     if (0 == e.Attributes.Count)
     {
         return;
     }
     _buffer.Append(OPENINLINEATTRIBUTES);
     foreach (var a in e.Attributes)
     {
         WriteAttribute(a);
     }
     _buffer.Append(CLOSEINLINEATTRIBUTES);
 }
Example #3
0
 /// <summary>
 /// Универсальный метод добавления элементов
 /// </summary>
 /// <param name="element"></param>
 /// <returns></returns>
 public GraphElementBase AddElement(GraphElementBase element)
 {
     if (element is Node)
     {
         return(AddNode((Node)element));
     }
     if (element is Edge)
     {
         return(AddEdge((Edge)element));
     }
     if (element is SubGraph)
     {
         return(AddSubGraph((SubGraph)element));
     }
     throw new Exception("unknown element");
 }