private void MakeLegitimateCommandExecute() { var toRemove = new List <string>(); foreach (string thing in SelectedThings) { AntiHacker.MakeLegitimate(thing); toRemove.Add(thing); } foreach (var item in toRemove) { DodgyStuff.Remove(item); } }
private void DeleteCommandExecute() { if (MessageBox.Show("Are you sure you want to delete all the selected files from the web site?", Title, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes) { var toRemove = new List <string>(); foreach (string thing in SelectedThings) { if (AntiHacker.Delete(thing)) { toRemove.Add(thing); } else { MessageBox.Show($"Sorry! I can't delete '{thing}'. You will have to do it yourself.", "WebWriter"); } } foreach (var item in toRemove) { DodgyStuff.Remove(item); } } }