Exemplo n.º 1
0
        private void RegisterNamespace(string rwHtmlNamespace, ClrNamespaceWithAssembly clrNamespace)
        {
            List<ClrNamespaceWithAssembly> items;
            if (!mapping.TryGetValue(rwHtmlNamespace, out items))
            {
                items = new List<ClrNamespaceWithAssembly>();
                mapping.Add(rwHtmlNamespace, items);
            }

            items.Add(clrNamespace);
        }
Exemplo n.º 2
0
        private Type GetTypeFromCrlNamespace(ClrNamespaceWithAssembly clrNamespace, string name)
        {
            Assembly assembly;
            if(!loadedAssemblies.TryGetValue(clrNamespace.AssemblyName, out assembly))
            {
                assembly = Assembly.Load(clrNamespace.AssemblyName);
                loadedAssemblies.Add(clrNamespace.AssemblyName, assembly);
            }

            var result = assembly.GetType(clrNamespace.ClrNamespace + "." + name);
            return result;
        }
Exemplo n.º 3
0
 public void LoadAssemblies(string[] assembliesToLoad)
 {
     foreach (var assemblyName in assembliesToLoad)
     {
         var assembly = Assembly.Load(assemblyName);
         foreach (var atr in assembly.GetCustomAttributes<RwHtmlNamespaceDefinitionAttribute>())
         {
             var clrNamespace = new ClrNamespaceWithAssembly(atr.ClrNamespace, assemblyName);
             RegisterNamespace(atr.RwHtmlNamespace, clrNamespace);
         }
     }
 }