public async Task PurgeMessages(IEnumerable <QueueItem> itms) { _log.Trace("Purge Messages..."); InvokeWhileMonitoringPaused(() => { foreach (var itm in itms) { _mgr.PurgeMessage(itm); } }); }
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); }
public void PurgeMessage(QueueItem itm) { _mgr.PurgeMessage(itm); }
private void miDeleteMessage_Click(object sender, RoutedEventArgs e) { QueueItem itm = ((MenuItem)sender).Tag as QueueItem; _mgr.PurgeMessage(itm); }