public void AddComment()
{
//ExStart
//ExFor:Comment
//ExFor:InlineStory
//ExFor:InlineStory.Paragraphs
//ExFor:InlineStory.FirstParagraph
//ExFor:Comment.#ctor(DocumentBase, String, String, DateTime)
//ExSummary:Shows how to add a comment to a paragraph in the document.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Write("Some text is added.");
Comment comment = new Comment(doc, "Amy Lee", "AL", DateTime.Today);
builder.CurrentParagraph.AppendChild(comment);
comment.Paragraphs.Add(new Paragraph(doc));
comment.FirstParagraph.Runs.Add(new Run(doc, "Comment text."));
//ExEnd
Assert.AreEqual("Comment text.\r", (doc.GetChildNodes(NodeType.Comment, true)[0]).GetText());
}
}