25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

76 lines
943 B

  1. using System;
  2. using System.Collections.Generic;
  3. [Serializable]
  4. public class XMLText : IXMLNode
  5. {
  6. public XMLText(string text, IXMLNode parent)
  7. {
  8. this.valueString = text;
  9. this.parentNode = parent;
  10. if (parent != null)
  11. {
  12. parent.Children.Add(this);
  13. }
  14. }
  15. public string value
  16. {
  17. get
  18. {
  19. return this.valueString;
  20. }
  21. set
  22. {
  23. this.valueString = value;
  24. }
  25. }
  26. public XMLNodeType type
  27. {
  28. get
  29. {
  30. return XMLNodeType.Text;
  31. }
  32. }
  33. public IXMLNode Parent
  34. {
  35. get
  36. {
  37. return this.parentNode;
  38. }
  39. }
  40. public List<IXMLNode> Children
  41. {
  42. get
  43. {
  44. return new List<IXMLNode>();
  45. }
  46. set
  47. {
  48. }
  49. }
  50. public List<XMLAttribute> Attributes
  51. {
  52. get
  53. {
  54. return new List<XMLAttribute>();
  55. }
  56. set
  57. {
  58. }
  59. }
  60. public override string ToString()
  61. {
  62. return this.valueString;
  63. }
  64. protected string valueString;
  65. protected IXMLNode parentNode;
  66. }