using System.Collections;
using System.Globalization;
using System.Runtime.InteropServices;
-
+#if !FULL_AOT_RUNTIME
+using System.Reflection.Emit;
+#endif
+using System.Collections.Generic;
namespace System.Reflection {
#endif
Type GetType (string name, bool throwOnError, bool ignoreCase)
{
+ Type res;
if (name == null)
throw new ArgumentNullException (name);
if (name.Length == 0)
throw new ArgumentException ("name", "Name cannot be empty");
- return InternalGetType (null, name, throwOnError, ignoreCase);
+ res = InternalGetType (null, name, throwOnError, ignoreCase);
+#if !NET_4_0 && !FULL_AOT_RUNTIME
+ if (res is TypeBuilder) {
+ if (throwOnError)
+ throw new TypeLoadException (string.Format ("Could not load type '{0}' from assembly '{1}'", name, this));
+ return null;
+ }
+#endif
+ return res;
}
public
Module[] modules = GetModulesInternal ();
if (!getResourceModules) {
- ArrayList result = new ArrayList (modules.Length);
+ var result = new List<Module> (modules.Length);
foreach (Module m in modules)
if (!m.IsResource ())
result.Add (m);
- return (Module[])result.ToArray (typeof (Module));
+ return result.ToArray ();
}
else
return modules;
}
}
-#if !MOONLIGHT
public
#if NET_4_0
override
return get_global_assembly_cache ();
}
}
-#endif
-
}
}