protected static Type FindClass( String className, Assembly module )
{
Type cls = null;
if (module == null)
{
// find the class using regular methods
cls = Type.GetType( className );
// this failed, so try again with "System." in front
if (cls == null)
{
for (int i = 0; i < packagesToAttempt.Length; i++)
{
cls = Type.GetType( packagesToAttempt[ i ] + "." + className );
if (cls != null)
{
break;
}
}
}
}
else
{
// find the class using the given module
cls = module.GetType( className );
// this failed, so try again with "System." in front
if (cls == null)
{
for (int i = 0; i < packagesToAttempt.Length; i++)
{
cls = module.GetType( packagesToAttempt[ i ] + "." + className );
if (cls != null)
{
break;
}
}
}
}
return cls;
}