All pastes #275783 Raw Edit

Something

public text v1 · immutable
·published 2006-12-11 20:17 UTC
rendered paste body
System.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);				
	}
}