/// <exception cref="ArgumentNullException"> /// <paramref name="comment"/> or <paramref name="entity"/> is null. /// </exception> public CommentRelationship AddCommentRelationship(Comment comment, IEntity entity) { CommentRelationship commentRelationship = new CommentRelationship(comment, entity); AddRelationship(commentRelationship); return(commentRelationship); }
private CommentRelationship AddCommentRelationship(CommentRelationship commentRelationship) { Shape startShape = GetShape(commentRelationship.First); Shape endShape = GetShape(commentRelationship.Second); AddConnection(new CommentConnection(commentRelationship, startShape, endShape)); return(commentRelationship); }
public bool InsertCommentRelationship(CommentRelationship commentRelationship) { if (commentRelationship != null && !model.Relationships.Contains(commentRelationship) && model.Entities.Contains(commentRelationship.First) && model.Entities.Contains(commentRelationship.Second)) { AddCommentRelationship(commentRelationship); return(true); } return(false); }
protected override bool CloneRelationship(Diagram diagram, Shape first, Shape second) { Comment comment = first.Entity as Comment; if (comment != null) { CommentRelationship clone = CommentRelationship.Clone(comment, second.Entity); return(diagram.InsertCommentRelationship(clone)); } return(false); }
protected override bool CloneRelationship(IDiagram diagram, Shape first, Shape second) { if (first.Entity is Comment comment) { CommentRelationship clone = relationship.Clone(comment, second.Entity); return(diagram.InsertCommentRelationship(clone)); } else { return(false); } }
protected override bool CloneRelationship(IDiagram diagram, Shape first, Shape second) { if (diagram.DiagramType != DiagramType.ClassDiagram) { return(false); } Comment comment = first.Entity as Comment; if (comment != null) { CommentRelationship clone = relationship.Clone(comment, second.Entity); return(((ClassDiagram)diagram).InsertCommentRelationship(clone)); } else { return(false); } }
/// <exception cref="ArgumentNullException"> /// <paramref name="relationship"/> is null.-or- /// <paramref name="startShape"/> is null.-or- /// <paramref name="endShape"/> is null. /// </exception> public CommentConnection(CommentRelationship relationship, Shape startShape, Shape endShape) : base(relationship, startShape, endShape) { this.relationship = relationship; }
/// <exception cref="ArgumentNullException"> /// <paramref name="comment"/> or <paramref name="entity"/> is null. /// </exception> public CommentRelationship AddCommentRelationship(Comment comment, IEntity entity) { CommentRelationship commentRelationship = new CommentRelationship(comment, entity); AddRelationship(commentRelationship); return commentRelationship; }
public bool InsertCommentRelationship(CommentRelationship commentRelationship) { return(model.InsertRelationship(commentRelationship)); }