/ILSpy.BamlDecompiler/Ricciolo.StylesExplorer.MarkupReflection/XmlBamlElement.cs

http://github.com/icsharpcode/ILSpy · C# · 65 lines · 49 code · 14 blank · 2 comment · 0 complexity · e1cdc9b8f6f50719b22456d9754ba2c3 MD5 · raw file

  1. // Copyright (c) Cristian Civera (cristian@aspitalia.com)
  2. // This code is distributed under the MS-PL (for details please see \doc\MS-PL.txt)
  3. using System;
  4. using System.Collections;
  5. using System.Collections.Generic;
  6. using System.Text;
  7. using System.Xml;
  8. namespace Ricciolo.StylesExplorer.MarkupReflection
  9. {
  10. class XmlBamlElement : XmlBamlNode
  11. {
  12. XmlNamespaceCollection _namespaces = new XmlNamespaceCollection();
  13. public XmlBamlElement()
  14. {
  15. }
  16. public XmlBamlElement(XmlBamlElement parent)
  17. {
  18. this.Parent = parent;
  19. this.Namespaces.AddRange(parent.Namespaces);
  20. }
  21. public XmlNamespaceCollection Namespaces {
  22. get { return _namespaces; }
  23. }
  24. public XmlBamlElement Parent { get; private set; }
  25. public TypeDeclaration TypeDeclaration { get; set; }
  26. public override XmlNodeType NodeType {
  27. get { return XmlNodeType.Element; }
  28. }
  29. public long Position { get; set; }
  30. public bool IsImplicit { get; set; }
  31. public override string ToString()
  32. {
  33. return string.Format("Element: {0}", TypeDeclaration.Name);
  34. }
  35. }
  36. class XmlBamlEndElement : XmlBamlElement
  37. {
  38. public XmlBamlEndElement(XmlBamlElement start)
  39. {
  40. this.TypeDeclaration = start.TypeDeclaration;
  41. this.Namespaces.AddRange(start.Namespaces);
  42. }
  43. public override XmlNodeType NodeType {
  44. get { return XmlNodeType.EndElement; }
  45. }
  46. public override string ToString()
  47. {
  48. return string.Format("EndElement: {0}", TypeDeclaration.Name);
  49. }
  50. }
  51. }