コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: dizzydezz/jmm
		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;
		}
コード例 #2
0
        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);
            }
        }