public bool BeforeStopping() { Shell.BeginInvoke((MethodInvoker)(() => { if (_btnAuto.All(a => { a.Enabled = true; return(true); })) { RefreshAction(); } })); Thread.Sleep(1500); return(true); }