2002-12-21 Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
[mono.git] / mcs / class / System.XML / System.Xml / XmlComment.cs
1 //
2 // System.Xml.XmlComment
3 //
4 // Author:
5 //   Kral Ferch <kral_ferch@hotmail.com>
6 //
7 // (C) 2002 Kral Ferch
8 //
9
10 using System;
11 using System.Xml.XPath;
12
13 namespace System.Xml
14 {
15         public class XmlComment : XmlCharacterData
16         {
17                 #region Constructors
18
19                 protected internal XmlComment (string comment, XmlDocument doc)
20                         : base (comment, doc)
21                 {
22                 }
23
24                 #endregion
25
26                 #region Properties
27
28                 public override string LocalName {
29                         get { return "#comment"; }
30                 }
31
32                 public override string Name {
33                         get { return "#comment"; }
34                 }
35
36                 public override XmlNodeType NodeType {
37                         get { return XmlNodeType.Comment; }
38                 }
39                 
40                 internal override XPathNodeType XPathNodeType {
41                         get {
42                                 return XPathNodeType.Comment;
43                         }
44                 }
45
46                 #endregion
47
48                 #region Methods
49
50                 public override XmlNode CloneNode (bool deep)
51                 {
52                         // discard deep because Comments have no children.
53                         return new XmlComment(Value, OwnerDocument); 
54                 }
55
56                 public override void WriteContentTo (XmlWriter w) { }
57
58                 public override void WriteTo (XmlWriter w)
59                 {
60                         w.WriteComment (Data);
61                 }
62
63                 #endregion
64         }
65 }