예제 #1
0
        public async Task PurgeMessages(IEnumerable <QueueItem> itms)
        {
            _log.Trace("Purge Messages...");

            InvokeWhileMonitoringPaused(() => {
                foreach (var itm in itms)
                {
                    _mgr.PurgeMessage(itm);
                }
            });
        }
예제 #2
0
        public async Task PurgeMessages(IEnumerable <QueueItem> itms)
        {
            if (_currentMonitor == null)
            {
                return;
            }

            BackgroundWorker bw = new BackgroundWorker();

            bw.DoWork += (sender, arg) => {
                ThreadState s = arg.Argument as ThreadState;
                PauseMonitoring();
                OnStartedLoadingQueues();

                while (!s.Paused)
                {
                    Thread.Sleep(100);
                }

                try {
                    foreach (var itm in itms)
                    {
                        _mgr.PurgeMessage(itm);
                    }
                } finally {
                    OnFinishedLoadingQueues();
                    ResumeMonitoring();
                }
            };

            bw.RunWorkerCompleted += (object s, RunWorkerCompletedEventArgs ev) => {
                if (ev.Error != null)
                {
                    throw ev.Error;
                }
            };

            bw.RunWorkerAsync(_currentMonitor);
        }
예제 #3
0
 public void PurgeMessage(QueueItem itm)
 {
     _mgr.PurgeMessage(itm);
 }
예제 #4
0
        private void miDeleteMessage_Click(object sender, RoutedEventArgs e)
        {
            QueueItem itm = ((MenuItem)sender).Tag as QueueItem;

            _mgr.PurgeMessage(itm);
        }