Update msvc README file.
[mono.git] / docs / HtmlAgilityPack / HtmlCommentNode.cs
1 // HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>\r
2 namespace HtmlAgilityPack\r
3 {\r
4     /// <summary>\r
5     /// Represents an HTML comment.\r
6     /// </summary>\r
7     public class HtmlCommentNode : HtmlNode\r
8     {\r
9         #region Fields\r
10 \r
11         private string _comment;\r
12 \r
13         #endregion\r
14 \r
15         #region Constructors\r
16 \r
17         internal HtmlCommentNode(HtmlDocument ownerdocument, int index)\r
18             :\r
19                 base(HtmlNodeType.Comment, ownerdocument, index)\r
20         {\r
21         }\r
22 \r
23         #endregion\r
24 \r
25         #region Properties\r
26 \r
27         /// <summary>\r
28         /// Gets or Sets the comment text of the node.\r
29         /// </summary>\r
30         public string Comment\r
31         {\r
32             get\r
33             {\r
34                 if (_comment == null)\r
35                 {\r
36                     return base.InnerHtml;\r
37                 }\r
38                 return _comment;\r
39             }\r
40             set { _comment = value; }\r
41         }\r
42 \r
43         /// <summary>\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
45         /// </summary>\r
46         public override string InnerHtml\r
47         {\r
48             get\r
49             {\r
50                 if (_comment == null)\r
51                 {\r
52                     return base.InnerHtml;\r
53                 }\r
54                 return _comment;\r
55             }\r
56             set { _comment = value; }\r
57         }\r
58 \r
59         /// <summary>\r
60         /// Gets or Sets the object and its content in HTML.\r
61         /// </summary>\r
62         public override string OuterHtml\r
63         {\r
64             get\r
65             {\r
66                 if (_comment == null)\r
67                 {\r
68                     return base.OuterHtml;\r
69                 }\r
70                 return "<!--" + _comment + "-->";\r
71             }\r
72         }\r
73 \r
74         #endregion\r
75     }\r
76 }