Beispiel #1
0
 public CommentObject Clone()
 {
     CommentObject newCom = new CommentObject();
     newCom.PreceedingComments.AddRange(PreceedingComments);
     newCom.TrailingComment = TrailingComment;
     return newCom;
 }
Beispiel #2
0
        public CommentObject Clone()
        {
            CommentObject newCom = new CommentObject();

            newCom.PreceedingComments.AddRange(PreceedingComments);
            newCom.TrailingComment = TrailingComment;
            return(newCom);
        }
Beispiel #3
0
        public bool IsTheSame(CommentObject comments)
        {
            if (comments == null)
                return false;

            if (Utility.StringCollectionsAreTheSame(PreceedingComments, comments.PreceedingComments) == false)
            {
                return false;
            }
            if (Equals(TrailingComment, comments.TrailingComment) == false)
            {
                return false;
            }

            return true;
        }
Beispiel #4
0
        public bool IsTheSame(CommentObject comments)
        {
            if (comments == null)
            {
                return(false);
            }

            if (Utility.StringCollectionsAreTheSame(PreceedingComments, comments.PreceedingComments) == false)
            {
                return(false);
            }
            if (Equals(TrailingComment, comments.TrailingComment) == false)
            {
                return(false);
            }

            return(true);
        }
Beispiel #5
0
        private void SetTrailingComment(KeyValuePair<int, Comment> comment, CommentObject commentObject)
        {
            string newComment = Helper.StandardizeLineBreaks(comment.Value.Text.Trim(), Environment.NewLine);

            if (formatSettings.CommentLinesAsCommentBlock)
            {
                newComment = "/* " + newComment.Replace("/*", "").Replace("*/", "").Replace("//", "").Trim() + " */";
            }

            string currentComment = commentObject.TrailingComment;
            if (string.IsNullOrEmpty(currentComment) == false)
            {
                commentObject.TrailingComment +=
                    Environment.NewLine + newComment;
            }
            else
            {
                commentObject.TrailingComment = newComment;
            }
        }