public TestRunnerUi(ItestRunner runner) { InitializeComponent(); m_runner = runner; m_runner.PropertyChanged+=new PropertyChangedEventHandler(Runner_PropertyChanged); treeTests.DrawMode = TreeViewDrawMode.OwnerDrawText; treeTests.DrawNode += new DrawTreeNodeEventHandler(treeTests_DrawNode); treeTests.CheckBoxes = true; }
/// <summary> /// Load the test runner plugin which run the test executable /// </summary> /// <param name="dllPath">Path to the Dll</param> /// <param name="className">Class name of the plugin</param> protected void LoadTestRunnerPlugin(string dllPath, string className) { Type ObjType = null; if (File.Exists(dllPath)) { try { Assembly ass = null; ass = Assembly.LoadFile(dllPath); if (ass != null) { ObjType = ass.GetType(className); if (ObjType != null) { ItestRunner plugin = (ItestRunner)Activator.CreateInstance(ObjType); if (plugin != null) { plugin.registerCallBack(this); PluginList.Add(plugin); m_TestRunner = plugin; plugin.Owner = this; plugin.Show(dockParent, WeifenLuo.WinFormsUI.Docking.DockState.DockRightAutoHide); evPluginLoaded(plugin); } else { //do nothing } } } } catch (Exception err) { MessageBox.Show(err.ToString()); } } }