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

http://github.com/icsharpcode/ILSpy · C# · 58 lines · 36 code · 8 blank · 14 comment · 0 complexity · 1311766ac819ce871ddd2f3f5ab2ed4d 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. namespace Ricciolo.StylesExplorer.MarkupReflection
  5. {
  6. /// <summary>
  7. /// Rappresenta la mappatura tra namespace XML e namespace CLR con relativo assembly
  8. /// </summary>
  9. public class XmlPIMapping
  10. {
  11. string _xmlNamespace;
  12. string assemblyName;
  13. string _clrNamespace;
  14. public const string XamlNamespace = "http://schemas.microsoft.com/winfx/2006/xaml";
  15. public const string PresentationNamespace = "http://schemas.microsoft.com/winfx/2006/xaml/presentation";
  16. public const string PresentationOptionsNamespace = "http://schemas.microsoft.com/winfx/2006/xaml/presentation/options";
  17. public const string McNamespace = "http://schemas.openxmlformats.org/markup-compatibility/2006";
  18. public XmlPIMapping(string xmlNamespace, string assembly, string clrNamespace)
  19. {
  20. _xmlNamespace = xmlNamespace;
  21. assemblyName = assembly;
  22. _clrNamespace = clrNamespace;
  23. }
  24. /// <summary>
  25. /// Restituisce o imposta il namespace XML
  26. /// </summary>
  27. public string XmlNamespace
  28. {
  29. get { return _xmlNamespace; }
  30. set { _xmlNamespace = value;}
  31. }
  32. /// <summary>
  33. /// Name of the assembly.
  34. /// </summary>
  35. public string Assembly {
  36. get { return assemblyName; }
  37. }
  38. /// <summary>
  39. /// Restituisce il namespace clr
  40. /// </summary>
  41. public string ClrNamespace
  42. {
  43. get { return _clrNamespace; }
  44. }
  45. public static XmlPIMapping GetPresentationMapping(Func<short, string> assemblyResolve)
  46. {
  47. return new XmlPIMapping(PresentationNamespace, assemblyResolve(0), string.Empty);
  48. }
  49. }
  50. }