private void OnDeleteIconButtonClick(object sender, EventArgs e) { if (!App.isNetworkAvailable()) { Exception connErr = new NoConnectionException(); this.HandleException(connErr); return; } string prompt = _localizedStrings.Prompts.ConfirmDeleteComment; if (_messageBoxIsShown) { return; } _messageBoxIsShown = true; MessageBoxResult result = MessageBox.Show(prompt, _localizedStrings.Prompts.Confirm, MessageBoxButton.OKCancel); _messageBoxIsShown = false; if (result == MessageBoxResult.OK) { Comment comment = DataContext as Comment; DeleteCommentRPC rpc = new DeleteCommentRPC(App.MasterViewModel.CurrentBlog, comment); rpc.Completed += OnDeleteCommentRPCCompleted; rpc.ExecuteAsync(); _currentConnection = rpc; ApplicationBar.IsVisible = false; App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.DeletingComment); } else { return; } }
public void ExecuteAsync() { ValidateValues(); if (0 == Comments.Count) { List<Comment> items = new List<Comment>(); XMLRPCCompletedEventArgs<Comment> args = new XMLRPCCompletedEventArgs<Comment>(items, null, false, null); NotifyCompleted(args); return; } //initialize our counter ivar _numberOfCompletedRPCs = 0; //initialize our success/failure collections if (null != _successes) { _successes.Clear(); _successes = null; } _successes = new List<XMLRPCCompletedEventArgs<Comment>>(); if (null != _failures) { _failures.Clear(); _failures = null; } _failures = new List<XMLRPCCompletedEventArgs<Comment>>(); _operation = AsyncOperationManager.CreateOperation(Guid.NewGuid()); foreach (Comment comment in Comments) { DeleteCommentRPC rpc = new DeleteCommentRPC(DataService.Current.CurrentBlog, comment); rpc.Completed += OnDeleteCommentRPCCompleted; rpc.ExecuteAsync(); } }
private void OnDeleteIconButtonClick(object sender, EventArgs e) { if (!App.isNetworkAvailable()) { Exception connErr = new NoConnectionException(); this.HandleException(connErr); return; } string prompt = _localizedStrings.Prompts.ConfirmDeleteComment; if (_messageBoxIsShown) return; _messageBoxIsShown = true; MessageBoxResult result = MessageBox.Show(prompt, _localizedStrings.Prompts.Confirm, MessageBoxButton.OKCancel); _messageBoxIsShown = false; if (result == MessageBoxResult.OK) { Comment comment = DataContext as Comment; DeleteCommentRPC rpc = new DeleteCommentRPC(App.MasterViewModel.CurrentBlog, comment); rpc.Completed += OnDeleteCommentRPCCompleted; rpc.ExecuteAsync(); _currentConnection = rpc; ApplicationBar.IsVisible = false; App.WaitIndicationService.ShowIndicator(_localizedStrings.Messages.DeletingComment); } else { return; } }