Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #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);
        }
 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);
     }
 }
Exemple #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;
 }
Exemple #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;
        }
Exemple #9
0
 public bool InsertCommentRelationship(CommentRelationship commentRelationship)
 {
     return(model.InsertRelationship(commentRelationship));
 }