public async override Task <bool> ActionAsync(string action) { bool result = base.Action(action); if (result && action == ACTION_FILTER) { using (LogPurgerForm dlg = new LogPurgerForm()) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { using (Utils.FrameworkDataUpdater upd = new Utils.FrameworkDataUpdater(Core)) { await Task.Run(() => { this.purgeLogsWithFilterThreadMethod(); }); } } } } else if (result && action == ACTION_QUICKPURGE) { using (Utils.FrameworkDataUpdater upd = new Utils.FrameworkDataUpdater(Core)) { await Task.Run(() => { this.purgeLogsThreadMethod(); }); } } return(result); }
public async override Task<bool> ActionAsync(string action) { bool result = base.Action(action); if (result && action == ACTION_FILTER) { using (LogPurgerForm dlg = new LogPurgerForm()) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { using (Utils.FrameworkDataUpdater upd = new Utils.FrameworkDataUpdater(Core)) { await Task.Run(() => { this.purgeLogsWithFilterThreadMethod(); }); } } } } else if (result && action == ACTION_QUICKPURGE) { using (Utils.FrameworkDataUpdater upd = new Utils.FrameworkDataUpdater(Core)) { await Task.Run(() => { this.purgeLogsThreadMethod(); }); } } return result; }
public override bool Action(string action) { bool result = base.Action(action); if (result && action == ACTION_FILTER) { using (LogPurgerForm dlg = new LogPurgerForm()) { if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK) { using (Utils.FrameworkDataUpdater upd = new Utils.FrameworkDataUpdater(Core)) { _actionReady = new ManualResetEvent(false); Thread thrd = new Thread(new ThreadStart(this.purgeLogsWithFilterThreadMethod)); thrd.Start(); while (!_actionReady.WaitOne(10)) { System.Windows.Forms.Application.DoEvents(); } thrd.Join(); _actionReady.Dispose(); _actionReady = null; } } } } else if (result && action == ACTION_QUICKPURGE) { using (Utils.FrameworkDataUpdater upd = new Utils.FrameworkDataUpdater(Core)) { _actionReady = new ManualResetEvent(false); Thread thrd = new Thread(new ThreadStart(this.purgeLogsThreadMethod)); thrd.Start(); while (!_actionReady.WaitOne(10)) { System.Windows.Forms.Application.DoEvents(); } thrd.Join(); _actionReady.Dispose(); _actionReady = null; } } return result; }