XmlDocumentFragment.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // System.Xml.XmlDocumentFragment
  3. //
  4. // Author:
  5. // Duncan Mak ([email protected])
  6. //
  7. // (C), Ximian, Inc
  8. //
  9. using System;
  10. namespace System.Xml
  11. {
  12. public class XmlDocumentFragment : XmlNode
  13. {
  14. #region Constructor
  15. internal XmlDocumentFragment (XmlDocument doc)
  16. : base (doc)
  17. {
  18. }
  19. #endregion
  20. #region Properties
  21. [MonoTODO]
  22. public override string InnerXml {
  23. get { throw new NotImplementedException(); }
  24. }
  25. public override string LocalName {
  26. get { return "#document-fragment"; }
  27. }
  28. public override string Name {
  29. get { return "#document-fragment"; }
  30. }
  31. public override XmlNodeType NodeType {
  32. get { return XmlNodeType.DocumentFragment; }
  33. }
  34. public override XmlDocument OwnerDocument {
  35. get { return base.OwnerDocument; }
  36. }
  37. public override XmlNode ParentNode {
  38. get { return null; } // it's always null here.
  39. }
  40. #endregion
  41. #region Methods
  42. public override XmlNode CloneNode (bool deep)
  43. {
  44. if (deep) { // clone document + child nodes
  45. XmlNode node = FirstChild;
  46. while ((node != null) && (node.HasChildNodes)) {
  47. AppendChild (node.NextSibling.CloneNode (false));
  48. node = node.NextSibling;
  49. }
  50. return node;
  51. } else
  52. return new XmlDocumentFragment (OwnerDocument);
  53. }
  54. [MonoTODO]
  55. public override void WriteContentTo (XmlWriter w)
  56. {
  57. throw new NotImplementedException ();
  58. }
  59. [MonoTODO]
  60. public override void WriteTo (XmlWriter w)
  61. {
  62. throw new NotImplementedException ();
  63. }
  64. #endregion
  65. }
  66. }