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

http://github.com/icsharpcode/ILSpy · C# · 47 lines · 38 code · 7 blank · 2 comment · 0 complexity · 0b476a084955f432e2ba9a24db28a9cf 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.Generic;
  5. using System.Text;
  6. namespace Ricciolo.StylesExplorer.MarkupReflection
  7. {
  8. internal class XmlBamlPropertyElement : XmlBamlElement
  9. {
  10. private readonly PropertyType _propertyType;
  11. private PropertyDeclaration propertyDeclaration;
  12. public XmlBamlPropertyElement(PropertyType propertyType, PropertyDeclaration propertyDeclaration)
  13. {
  14. _propertyType = propertyType;
  15. this.propertyDeclaration = propertyDeclaration;
  16. }
  17. public XmlBamlPropertyElement(XmlBamlElement parent, PropertyType propertyType, PropertyDeclaration propertyDeclaration)
  18. : base(parent)
  19. {
  20. _propertyType = propertyType;
  21. this.propertyDeclaration = propertyDeclaration;
  22. this.TypeDeclaration = propertyDeclaration.DeclaringType;
  23. }
  24. public PropertyDeclaration PropertyDeclaration
  25. {
  26. get
  27. {
  28. return this.propertyDeclaration;
  29. }
  30. }
  31. public PropertyType PropertyType
  32. {
  33. get { return _propertyType; }
  34. }
  35. public override string ToString()
  36. {
  37. return String.Format("PropertyElement: {0}.{1}", TypeDeclaration.Name.Replace('+', '.'), PropertyDeclaration.Name);
  38. }
  39. }
  40. }