/// <exception cref="RelationshipException"> /// Cannot create relationship between the two types. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parentType"/> or <paramref name="innerType"/> is null. /// </exception> public NestingRelationship AddNesting(INestable parentType, INestableChild innerType) { NestingRelationship nesting = new NestingRelationship(parentType, innerType); AddRelationship(nesting); return(nesting); }
/// <exception cref="RelationshipException"> /// Cannot create relationship between the two types. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parentType"/> or <paramref name="innerType"/> is null. /// </exception> public NestingRelationship AddNesting(CompositeType parentType, TypeBase innerType) { NestingRelationship nesting = new NestingRelationship(parentType, innerType); AddRelationship(nesting); return(nesting); }
protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second) { if (first.Entity is CompositeType firstType && second.Entity is TypeBase secondType) { NestingRelationship clone = NestingRelationship.Clone(firstType, secondType); return(diagram.InsertNesting(clone)); }
public NestingRelationship AddNesting(NestingRelationship nesting) { Shape startShape = GetShape(nesting.First); Shape endShape = GetShape(nesting.Second); AddConnection(new Nesting(nesting, startShape, endShape)); return(nesting); }
public bool InsertNesting(NestingRelationship nesting) { if (nesting != null && !model.Relationships.Contains(nesting) && model.Entities.Contains(nesting.First) && model.Entities.Contains(nesting.Second)) { AddNesting(nesting); return(true); } return(false); }
protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second) { var firstType = first.Entity as CompositeType; var secondType = second.Entity as TypeBase; if (firstType != null && secondType != null) { var clone = NestingRelationship.Clone(firstType, secondType); return(diagram.InsertNesting(clone)); } return(false); }
protected override bool CloneRelationship(IDiagram diagram, Shape first, Shape second) { if (diagram.DiagramType != DiagramType.ClassDiagram) { return(false); } CompositeType firstType = first.Entity as CompositeType; TypeBase secondType = second.Entity as TypeBase; if (firstType != null && secondType != null) { NestingRelationship clone = nesting.Clone(firstType, secondType); return(((ClassDiagram)diagram).InsertNesting(clone)); } else { return(false); } }
/// <exception cref="ArgumentNullException"> /// <paramref name="nesting"/> is null.-or- /// <paramref name="startShape"/> is null.-or- /// <paramref name="endShape"/> is null. /// </exception> public Nesting(NestingRelationship nesting, Shape startShape, Shape endShape) : base(nesting, startShape, endShape) { this.nesting = nesting; }
public bool InsertNesting(NestingRelationship nesting) { return(model.InsertRelationship(nesting)); }
/// <exception cref="RelationshipException"> /// Cannot create relationship between the two types. /// </exception> /// <exception cref="ArgumentNullException"> /// <paramref name="parentType"/> or <paramref name="innerType"/> is null. /// </exception> public NestingRelationship AddNesting(CompositeType parentType, TypeBase innerType) { NestingRelationship nesting = new NestingRelationship(parentType, innerType); AddRelationship(nesting); return nesting; }