Browse Source

[cs] Allow resolveClass to resolve classes from other assemblies

Cauê Waneck 11 years ago
parent
commit
a00b33718c
1 changed files with 13 additions and 0 deletions
  1. 13 0
      std/cs/_std/Type.hx

+ 13 - 0
std/cs/_std/Type.hx

@@ -131,6 +131,19 @@ import cs.internal.Runtime;
 			name = "haxe.root." + name;
 #end
 		var t:cs.system.Type = cs.system.Type._GetType(name);
+#if !CF
+		if (t == null)
+		{
+			var all = cs.system.AppDomain.CurrentDomain.GetAssemblies().GetEnumerator();
+			while (all.MoveNext())
+			{
+				var t2:cs.system.reflection.Assembly = all.Current;
+				t = t2.GetType(name);
+				if (t != null)
+					break;
+			}
+		}
+#end
 		if (t == null)
 		{
 			switch(name)