XmlComment.cs 932 B

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