1 // HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
\r
2 namespace HtmlAgilityPack
\r
5 /// Represents an HTML comment.
\r
7 public class HtmlCommentNode : HtmlNode
\r
11 private string _comment;
\r
15 #region Constructors
\r
17 internal HtmlCommentNode(HtmlDocument ownerdocument, int index)
\r
19 base(HtmlNodeType.Comment, ownerdocument, index)
\r
28 /// Gets or Sets the comment text of the node.
\r
30 public string Comment
\r
34 if (_comment == null)
\r
36 return base.InnerHtml;
\r
40 set { _comment = value; }
\r
44 /// Gets or Sets the HTML between the start and end tags of the object. In the case of a text node, it is equals to OuterHtml.
\r
46 public override string InnerHtml
\r
50 if (_comment == null)
\r
52 return base.InnerHtml;
\r
56 set { _comment = value; }
\r
60 /// Gets or Sets the object and its content in HTML.
\r
62 public override string OuterHtml
\r
66 if (_comment == null)
\r
68 return base.OuterHtml;
\r
70 return "<!--" + _comment + "-->";
\r