public static void Main() { Master_Controls controls = new Master_Controls(); Thread appThread = new Thread(new ThreadStart(controls.ApplicationThread)); appThread.Start(); //wait until UI Window is created _autoEvent.WaitOne(); Thread.Sleep(500); string[] args = {"BorderTests", "CanvasTests","StackPanelTests", "TextTests", "PanelTests", "ImageTests", "TextFlowTests", "ScrollViewerTests", "ListBoxTests"}; MFTestRunner runner = new MFTestRunner(args); Log.Comment("Aborting the Application Thread"); try { controls.app.Dispatcher.Invoke(new TimeSpan(0, 0, 5), new DispatcherOperationCallback(controls.ShutDownApp), null); appThread.Abort(); } catch (Exception ex) { Log.Comment("Caught : " + ex.Message + " when aborting the application thread"); } }
public static void Main() { Master_Controls controls = new Master_Controls(); Thread appThread = new Thread(new ThreadStart(controls.ApplicationThread)); appThread.Start(); //wait until UI Window is created _autoEvent.WaitOne(); Thread.Sleep(500); string[] args = { "BorderTests", "CanvasTests", "StackPanelTests", "TextTests", "PanelTests", "ImageTests", "TextFlowTests", "ScrollViewerTests", "ListBoxTests" }; MFTestRunner runner = new MFTestRunner(args); Log.Comment("Aborting the Application Thread"); try { controls.app.Dispatcher.Invoke(new TimeSpan(0, 0, 5), new DispatcherOperationCallback(controls.ShutDownApp), null); appThread.Abort(); } catch (Exception ex) { Log.Comment("Caught : " + ex.Message + " when aborting the application thread"); } }