2002-09-15 Duncan Mak <duncan@ximian.com>
[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
12 namespace System.Xml
13 {
14         public class XmlComment : XmlCharacterData
15         {
16                 #region Constructors
17
18                 protected internal XmlComment (string comment, XmlDocument doc)
19                         : base (comment, doc)
20                 {
21                 }
22
23                 #endregion
24
25                 #region Properties
26
27                 public override string LocalName {
28                         get { return "#comment"; }
29                 }
30
31                 public override string Name {
32                         get { return "#comment"; }
33                 }
34
35                 public override XmlNodeType NodeType {
36                         get { return XmlNodeType.Comment; }
37                 }
38                 
39                 #endregion
40
41                 #region Methods
42
43                 public override XmlNode CloneNode (bool deep)
44                 {
45                         // discard deep because Comments have no children.
46                         return new XmlComment(Value, OwnerDocument); 
47                 }
48
49                 public override void WriteContentTo (XmlWriter w) { }
50
51                 public override void WriteTo (XmlWriter w)
52                 {
53                         w.WriteComment (Data);
54                 }
55
56                 #endregion
57         }
58 }