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

http://github.com/icsharpcode/ILSpy · C# · 40 lines · 32 code · 6 blank · 2 comment · 4 complexity · ec07ab87ccef07c735007ed8cafc30c1 MD5 · raw file

  1. // Copyright (c) AlphaSierraPapa for the SharpDevelop Team
  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. using System.Xml;
  7. namespace Ricciolo.StylesExplorer.MarkupReflection
  8. {
  9. class XmlBamlSimpleProperty : XmlBamlNode
  10. {
  11. public string NamespaceName { get; private set; }
  12. public string LocalName { get; private set; }
  13. public string Value { get; private set; }
  14. public XmlBamlSimpleProperty(string namespaceName, string localName, string value)
  15. {
  16. if (string.IsNullOrWhiteSpace(namespaceName))
  17. throw new ArgumentException("namespaceName");
  18. if (string.IsNullOrWhiteSpace(localName))
  19. throw new ArgumentException("localName");
  20. if (value == null)
  21. throw new ArgumentNullException("value");
  22. this.NamespaceName = namespaceName;
  23. this.LocalName = localName;
  24. this.Value = value;
  25. }
  26. public override XmlNodeType NodeType {
  27. get { return XmlNodeType.Attribute; }
  28. }
  29. public override string ToString()
  30. {
  31. return string.Format("{{{0}}}{1}=\"{2}\"", NamespaceName, LocalName, Value);
  32. }
  33. }
  34. }