XmlText.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
  2. //
  3. // System.Xml.XmlText
  4. //
  5. // Author:
  6. // Daniel Weber ([email protected])
  7. //
  8. // (C) 2001 Daniel Weber
  9. using System;
  10. namespace System.Xml
  11. {
  12. /// <summary>
  13. /// Represents the text content of an element or attribute
  14. /// </summary>
  15. public class XmlText : XmlNode
  16. {
  17. // Private data members
  18. // public properties
  19. public override string LocalName
  20. {
  21. get
  22. {
  23. return "#text";
  24. }
  25. }
  26. /// <summary>
  27. /// Get the name of the node.
  28. /// </summary>
  29. public override string Name
  30. {
  31. get
  32. {
  33. return "#text";
  34. }
  35. }
  36. public override XmlNodeType NodeType
  37. {
  38. get
  39. {
  40. return XmlNodeType.Text;
  41. }
  42. }
  43. // Public Methods
  44. //===========================================================================
  45. /// <summary>
  46. /// Override. Throw InvalidOperationException - text nodes do not have child nodes
  47. /// </summary>
  48. /// <param name="newChild">N/A</param>
  49. /// <param name="refChild">N/A</param>
  50. /// <returns>N/A</returns>
  51. public override XmlNode InsertAfter(XmlNode newChild, XmlNode refChild)
  52. {
  53. throw new InvalidOperationException("#text nodes do not have child nodes");
  54. }
  55. public override XmlNode CloneNode( bool deep)
  56. {
  57. throw new NotImplementedException();
  58. }
  59. public override void WriteContentTo(XmlWriter w)
  60. {
  61. throw new NotImplementedException();
  62. }
  63. public override void WriteTo(XmlWriter w)
  64. {
  65. throw new NotImplementedException();
  66. }
  67. // Internal method calls
  68. //===========================================================================
  69. // Constructors
  70. //===========================================================================
  71. internal XmlText (XmlDocument aOwnerDoc ) : base(aOwnerDoc)
  72. {
  73. }
  74. }
  75. }