/// <exception cref="ArgumentNullException"> /// <paramref name="first"/> or <paramref name="second"/> is null. /// </exception> public DependencyRelationship AddDependency(TypeBase first, TypeBase second) { DependencyRelationship dependency = new DependencyRelationship(first, second); AddRelationship(dependency); return(dependency); }
protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second) { if (first.Entity is TypeBase firstType && second.Entity is TypeBase secondType) { DependencyRelationship clone = DependencyRelationship.Clone(firstType, secondType); return(diagram.InsertDependency(clone)); }
private DependencyRelationship AddDependency(DependencyRelationship dependency) { Shape startShape = GetShape(dependency.First); Shape endShape = GetShape(dependency.Second); AddConnection(new Dependency(dependency, startShape, endShape)); return(dependency); }
public bool InsertDependency(DependencyRelationship dependency) { if (dependency != null && !model.Relationships.Contains(dependency) && model.Entities.Contains(dependency.First) && model.Entities.Contains(dependency.Second)) { AddDependency(dependency); return(true); } return(false); }
protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second) { var firstType = first.Entity as TypeBase; var secondType = second.Entity as TypeBase; if (firstType != null && secondType != null) { var clone = DependencyRelationship.Clone(firstType, secondType); return(diagram.InsertDependency(clone)); } return(false); }
protected override bool CloneRelationship(IDiagram diagram, Shape first, Shape second) { if (diagram.DiagramType != DiagramType.ClassDiagram) { return(false); } TypeBase firstType = first.Entity as TypeBase; TypeBase secondType = second.Entity as TypeBase; if (firstType != null && secondType != null) { DependencyRelationship clone = dependency.Clone(firstType, secondType); return(((ClassDiagram)diagram).InsertDependency(clone)); } else { return(false); } }
private static void NewNode() { // new SDI var sdi = Node.NewNode <SDI>(_mediator, null, "Final try", new Tuple <string, object>("DataCode", "ewrew"), new Tuple <string, object>("Section", "3333")); sdi.Save(); var comodity = Node.NewNode <Commodity>(_mediator, "Onthefly", "this is a commodity"); comodity.Save(); var co = Node.NewNode <ControlObject>(_mediator, "=122453/2132", "ssss"); co.Save(); var rel = new DependencyRelationship(); rel.SetNodes(co, comodity); rel.Save(); }
public Dependency(DependencyRelationship dependency, Shape startShape, Shape endShape) : base(dependency, startShape, endShape) { DependencyRelationship = dependency; }
public bool InsertDependency(DependencyRelationship dependency) { return(model.InsertRelationship(dependency)); }
/// <exception cref="ArgumentNullException"> /// <paramref name="first"/> or <paramref name="second"/> is null. /// </exception> public DependencyRelationship AddDependency(TypeBase first, TypeBase second) { DependencyRelationship dependency = new DependencyRelationship(first, second); AddRelationship(dependency); return dependency; }