示例#1
0
        /// <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);
        }
示例#2
0
        private CommentRelationship AddCommentRelationship(CommentRelationship commentRelationship)
        {
            Shape startShape = GetShape(commentRelationship.First);
            Shape endShape   = GetShape(commentRelationship.Second);

            AddConnection(new CommentConnection(commentRelationship, startShape, endShape));
            return(commentRelationship);
        }
示例#3
0
        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);
        }
示例#4
0
        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);
        }
示例#5
0
 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);
     }
 }
示例#6
0
        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;
 }
示例#8
0
        /// <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;
        }
示例#9
0
 public bool InsertCommentRelationship(CommentRelationship commentRelationship)
 {
     return(model.InsertRelationship(commentRelationship));
 }