rendered paste bodySystem.Reflection.Assembly thisAss = System.Reflection.Assembly.LoadFrom(System.IO.Path.Combine(System.Environment.CurrentDirectory,ControlToTestFileName));
System.Type typeToTest = thisAss.GetType(ControlMainComponentName);
if (typeToTest == null)
{
System.Windows.Forms.MessageBox.Show("Unable to find the correct object type to test." + System.Environment.NewLine + "Object Type: " + ControlMainComponentName);
}
else
{
System.Reflection.MethodInfo aboutBoxMethod = typeToTest.GetMethod("AboutBox");
if (aboutBoxMethod == null)
{
System.Windows.Forms.MessageBox.Show("Unable to find the AboutBox method for type " + typeToTest.FullName);
}
else
{
object testObject = Activator.CreateInstance(typeToTest);
aboutBoxMethod.Invoke(testObject,null);
}
}