AddHeaderComment() public method

Adds a header comment to this element.
public AddHeaderComment ( ICommentElement comment ) : void
comment ICommentElement The comment.
return void
Ejemplo n.º 1
0
        /// <summary>
        /// Creates a clone of the instance and assigns any state.
        /// </summary>
        /// <returns>Clone of this instance.</returns>
        public override object Clone()
        {
            CommentedElement clone = base.Clone() as CommentedElement;

            foreach (ICommentElement comment in HeaderComments)
            {
                ICommentElement commentClone = comment.Clone() as ICommentElement;
                clone.AddHeaderComment(commentClone);
            }

            return(clone);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Parses a member block.
        /// </summary>
        /// <param name="beginExpected">Begin block character expected.</param>
        /// <param name="parentElement">Element to parse the block for.</param>
        /// <returns>Block text.</returns>
        private string ParseBlock(bool beginExpected, CommentedElement parentElement)
        {
            List<ICommentElement> extraComments = new List<ICommentElement>();

            if (beginExpected)
            {
                // TODO: Assign any parsed comments to the parent element
                extraComments.AddRange(ParseComments());

                if (parentElement != null)
                {
                    foreach (ICommentElement comment in extraComments)
                    {
                        parentElement.AddHeaderComment(comment);
                    }
                }
            }

            return ParseNestedText(CSharpSymbol.BeginBlock, CSharpSymbol.EndBlock, beginExpected, true);
        }