Ejemplo n.º 1
0
 public static bool findResourceInAssembly(Assembly asm, string resourceName)
 {
     if (ReflectUtil.IsDynamicAssembly(asm))
     {
         return(false);
     }
     return(asm.GetManifestResourceInfo(JVM.MangleResourceName(resourceName)) != null);
 }
Ejemplo n.º 2
0
        public static object loadClassFromAssembly(Assembly asm, string className)
        {
            if (ReflectUtil.IsDynamicAssembly(asm))
            {
                return(null);
            }
            TypeWrapper tw = IKVM.Internal.AssemblyClassLoader.FromAssembly(asm).DoLoad(className);

            return(tw != null ? tw.ClassObject : null);
        }
Ejemplo n.º 3
0
        private static IEnumerable <global::java.net.URL> FindResources(string name)
        {
            List <IKVM.Internal.AssemblyClassLoader> done = new List <IKVM.Internal.AssemblyClassLoader>();

            foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
            {
                if (!ReflectUtil.IsDynamicAssembly(asm))
                {
                    IKVM.Internal.AssemblyClassLoader acl = IKVM.Internal.AssemblyClassLoader.FromAssembly(asm);
                    if (!done.Contains(acl))
                    {
                        done.Add(acl);
                        foreach (global::java.net.URL url in acl.FindResources(name))
                        {
                            yield return(url);
                        }
                    }
                }
            }
        }