first try using System.Type own GetType() method before looking deeper

This commit is contained in:
Michael Becker 2020-05-10 03:29:58 -04:00
parent 34db3a6bb6
commit 49bafecb94
No known key found for this signature in database
GPG Key ID: 506F54899E2BFED7

View File

@ -29,6 +29,11 @@ namespace MBS.Framework
private static Dictionary<string, Type> TypesByName = new Dictionary<string, Type>();
public static Type FindType(string TypeName)
{
// first try using System.Type own GetType() method
Type type = Type.GetType(TypeName);
if (type != null) return type;
// if we don't get it from that we look a little deeper through reflection
if (!TypesByName.ContainsKey(TypeName))
{
Assembly[] asms = GetAvailableAssemblies();