public static void Main() { Master_Presentation presentation = new Master_Presentation(); Thread appThread = new Thread(new ThreadStart(presentation.ApplicationThread)); appThread.Start(); //wait until UI Window is created autoEvent.WaitOne(); Thread.Sleep(3000); string[] args = { "UIElementTests" }; MFTestRunner runner = new MFTestRunner(args); Log.Comment("Aborting the Application Thread"); try { presentation.app.Dispatcher.Invoke(new TimeSpan(0, 0, 5), new DispatcherOperationCallback(presentation.ShutDownApp), null); appThread.Abort(); } catch (Exception ex) { Log.Comment("Caught : " + ex.Message + " when aborting the application thread"); } }
public static void Main() { Master_Presentation presentation = new Master_Presentation(); Thread appThread = new Thread(new ThreadStart(presentation.ApplicationThread)); appThread.Start(); //wait until UI Window is created autoEvent.WaitOne(); string[] args = { "UIElementTests" }; MFTestRunner runner = new MFTestRunner(args); Log.Comment("Aborting the Application Thread"); try { presentation.app.Dispatcher.Invoke(new TimeSpan(0, 0, 5), new DispatcherOperationCallback(presentation.ShutDownApp), null); appThread.Abort(); } catch (Exception ex) { Log.Comment("Caught : " + ex.Message + " when aborting the application thread"); } }