PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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