public virtual void PurgeQueue() { if (SelectedQueue == null) { return; } var confirmation = string.Format("All the messages in {0} will be removed. Continue?", SelectedQueue.Address); var result = _windowManager.ShowMessageBox(confirmation, "Warning", MessageBoxButton.OKCancel, MessageBoxImage.Question); if (result != MessageBoxResult.OK) { return; } _asyncQueueManager.Purge(SelectedQueue); RefreshMessages(); }
public virtual async Task PurgeQueue() { if (SelectedQueue == null) { return; } var confirmation = string.Format("All the messages in {0} will be removed. Continue?", SelectedQueue.Address); var dialogTitle = string.Format("Purge Queue: {0}", SelectedQueue.Address.Queue); var result = _windowManager.ShowMessageBox(confirmation, dialogTitle, MessageBoxButton.OKCancel, MessageBoxImage.Question, defaultChoice: MessageChoice.Cancel); if (result != MessageBoxResult.OK) { return; } _asyncQueueManager.Purge(SelectedQueue); await RefreshMessages(); }