void btnGeneralClear_Click(object sender, RoutedEventArgs e) { try { this.Cursor = Cursors.Wait; JMMService.CmdProcessorGeneral.Stop(); // wait until the queue stops while (JMMService.CmdProcessorGeneral.ProcessingCommands) { Thread.Sleep(200); } Thread.Sleep(200); CommandRequestRepository repCR = new CommandRequestRepository(); foreach (CommandRequest cr in repCR.GetAllCommandRequestGeneral()) repCR.Delete(cr.CommandRequestID); JMMService.CmdProcessorGeneral.Init(); } catch (Exception ex) { Utils.ShowErrorMessage(ex.Message); } this.Cursor = Cursors.Arrow; }
public void ClearGeneralQueue() { try { JMMService.CmdProcessorGeneral.Stop(); // wait until the queue stops while (JMMService.CmdProcessorGeneral.ProcessingCommands) { Thread.Sleep(200); } Thread.Sleep(200); CommandRequestRepository repCR = new CommandRequestRepository(); foreach (CommandRequest cr in repCR.GetAllCommandRequestGeneral()) repCR.Delete(cr.CommandRequestID); JMMService.CmdProcessorGeneral.Init(); } catch (Exception ex) { logger.ErrorException(ex.ToString(), ex); } }