All pastes #275752 Raw Edit

Miscellany

public text v1 · immutable
·published 2006-12-11 19:51 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);					
				}
			}