XmlComment.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //
  2. // System.Xml.XmlComment
  3. //
  4. // Author:
  5. // Kral Ferch <[email protected]>
  6. //
  7. // (C) 2002 Kral Ferch
  8. //
  9. using System;
  10. using System.Xml.XPath;
  11. namespace System.Xml
  12. {
  13. public class XmlComment : XmlCharacterData
  14. {
  15. #region Constructors
  16. protected internal XmlComment (string comment, XmlDocument doc)
  17. : base (comment, doc)
  18. {
  19. }
  20. #endregion
  21. #region Properties
  22. public override string LocalName {
  23. get { return "#comment"; }
  24. }
  25. public override string Name {
  26. get { return "#comment"; }
  27. }
  28. public override XmlNodeType NodeType {
  29. get { return XmlNodeType.Comment; }
  30. }
  31. internal override XPathNodeType XPathNodeType {
  32. get {
  33. return XPathNodeType.Comment;
  34. }
  35. }
  36. #endregion
  37. #region Methods
  38. public override XmlNode CloneNode (bool deep)
  39. {
  40. // discard deep because Comments have no children.
  41. return new XmlComment(Value, OwnerDocument);
  42. }
  43. public override void WriteContentTo (XmlWriter w) { }
  44. public override void WriteTo (XmlWriter w)
  45. {
  46. w.WriteComment (Data);
  47. }
  48. #endregion
  49. }
  50. }