void RunTests() { if (running) { Console.WriteLine("Already running"); return; } running = true; cmdRun.SetEnabled(false); lblStatus.SetText("Running in background"); var timer = NSTimer.CreateRepeatingScheduledTimer(TimeSpan.FromSeconds(1), (v) => RenderResults()); var runnerThread = new Thread(() => { runner.Run(); InvokeOnMainThread(() => { cmdRun.SetEnabled(true); lblStatus.SetText("Done"); running = false; timer.Dispose(); RenderResults(); }); }) { IsBackground = true, }; runnerThread.Start(); }
void RunTests() { cmdRun.SetEnabled(false); lblStatus.SetText("Running"); BeginInvokeOnMainThread(() => { runner.Run(); BeginInvokeOnMainThread(RenderResults); }); }
void RunTests() { if (running) { Console.WriteLine("Already running"); return; } running = true; cmdRun.SetEnabled(false); lblStatus.SetText("Running"); BeginInvokeOnMainThread(() => { runner.Run(); cmdRun.SetEnabled(true); lblStatus.SetText("Done"); running = false; RenderResults(); }); }