示例#1
0
        internal static void AddEdge(AdlibNode source, AdlibEdgeType type, AdlibNode target)
        {
            var edge = new AdlibEdge(source, type, target);

            AddSingleEdge(source.Edges, edge);
            AddSingleEdge(target.ReverseEdges, edge);
        }
示例#2
0
 protected static void AddSingleEdge(List <AdlibEdge> edges, AdlibEdge edge)
 {
     foreach (var existingEdge in edges)
     {
         if (edge.Source == existingEdge.Source && edge.Target == existingEdge.Target && edge.EdgeType == existingEdge.EdgeType)
         {
             return;
         }
     }
     edges.Add(edge);
 }
示例#3
0
        XElement CreateDGMLLink(AdlibEdge edge)
        {
            var element = new XElement(dgmlNS + "Link",
                                       new XAttribute("Source", edge.Source.Path),
                                       new XAttribute("Target", edge.Target.Path),
                                       new XAttribute("Label", edge.EdgeType)
                                       );

            if (edge.Traversed)
            {
                element.Add(new XAttribute("Category", "Traversed"));
            }
            return(element);
        }