Permalink
Browse files

2006-05-12 Michael Hutchinson <m.j.hutchinson@gmail.com>

	* TypeResolutionService.cs: Don't error out too easily when looking up 
	types. Also, resolve assembly-qualified type names.


svn path=/trunk/aspeditor/; revision=60640
  • Loading branch information...
1 parent feb8ff7 commit e1dc9eb52dbe0aa13fb428a38d73a1fb996f1bae @mhutch mhutch committed May 12, 2006
@@ -1,3 +1,8 @@
+2006-05-12 Michael Hutchinson <m.j.hutchinson@gmail.com>
+
+ * TypeResolutionService.cs: Don't error out too easily when looking up
+ types. Also, resolve assembly-qualified type names.
+
2006-04-26 Michael Hutchinson <m.j.hutchinson@gmail.com>
* ToolboxService.cs: Convert the TooboxItem arrays properly or they become
@@ -75,14 +75,20 @@ public string GetPathOfAssembly(AssemblyName name)
}
public Type GetType (string name, bool throwOnError, bool ignoreCase)
- {
- Type t = null;
+ {
+ //try to get assembly-qualified types
+ Type t = Type.GetType (name, false, ignoreCase);
+ if (t != null) return t;
+
+ //look in referenced assemblies
foreach (Assembly a in referencedAssemblies.Values)
{
- t = a.GetType (name, throwOnError, ignoreCase);
+ t = a.GetType (name, false, ignoreCase);
if (t != null) break;
- }
-
+ }
+
+ if (throwOnError && (t == null))
+ throw new Exception ("The type " + name + "was not found in the referenced assemblies.");
return t;
}

0 comments on commit e1dc9eb

Please sign in to comment.