Example #1
0
File: Form1.cs Project: fadeI/Coapp
 private void AddEdges()
 {
     foreach (var rel in data.AddVerticies())
     {
         if (rel.RelationType.Equals(RelationType.ManyToMany))
         {
             Edge e = (Edge)graph.AddEdge(rel.TableA.Name, rel.RelationType.ToString(), rel.TableB.Name);
             e.Attr.ArrowheadAtTarget = ArrowStyle.None;
             e.Attr.ArrowheadAtSource = ArrowStyle.None;
             e.LabelText = rel.RelationType.ToString();
         }
         else if (rel.RelationType.Equals(RelationType.OneToMany))
         {
             toWayoneToMany(rel.TableA.Name, rel.TableB.Name, rel.RelationType.ToString());
         }
         else if (rel.RelationType.Equals(RelationType.ManyToOne))
         {
             toWayoneToMany(rel.TableB.Name, rel.TableA.Name, rel.RelationType.ToString());
         }
         else if (rel.RelationType.Equals(RelationType.OneToOne))
         {
             Edge e = (Edge)graph.AddEdge(rel.TableA.Name, rel.TableB.Name);
             e.Attr.ArrowheadAtSource = ArrowStyle.Normal;
             e.Attr.ArrowheadAtTarget = ArrowStyle.Normal;
             e.LabelText = rel.RelationType.ToString();
         }
     }
 }