From a28666e5555990c7b76fe0d5d520c095fb5d4665 Mon Sep 17 00:00:00 2001 From: Alan McGovern Date: Wed, 11 Feb 2015 17:22:22 +0000 Subject: Add the ability to run cleanup just before shutdown Such a hack :) --- src/framework/GuiUnit/TestRunner.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/framework/GuiUnit/TestRunner.cs b/src/framework/GuiUnit/TestRunner.cs index 9ffe523..8e8e2c5 100644 --- a/src/framework/GuiUnit/TestRunner.cs +++ b/src/framework/GuiUnit/TestRunner.cs @@ -41,6 +41,7 @@ namespace GuiUnit static int ExitCode = 0; static bool initialized = false; static IMainLoopIntegration mainLoop; + public static event EventHandler BeforeShutdown; static TestRunner () { @@ -264,6 +265,8 @@ namespace GuiUnit // Run the shutdown method on the main thread var helper = new InvokerHelper { Func = () => { + if (BeforeShutdown != null) + BeforeShutdown (null, EventArgs.Empty); MainLoop.Shutdown (); return null; } -- cgit v1.2.3