private async Task OnDeletePresetCommand(Preset preset) { var dialog = new ConfirmDialog(Strings.YOU_ARE_ABOUT_TO_DELETE_THIS_ITEM_ARE_YOU_SURE); var result = await dialog.OpenAsync(); if (result) { try { // Delete preset _logger.Info("Deleting preset"); _presetManager.DeletePreset(preset); // Delete screenshots folder if (_configurationManager.Settings.DeleteScreenshotsWhenDeletingPreset) { _logger.Info("Deleting screenshot directory"); _screenshotManager.DeleteScreenshotDirectory(Paths.GetPresetScreenshotsDirectory(_game.Module, preset.Name)); } RaisePropertyChanged(nameof(Presets)); _eventAggregator.GetEvent <ShowSnackbarMessageEvent>().Publish(Strings.PRESET_DELETED); } catch (DirectoryNotFoundException ex) { _logger.Warn(ex); } Presets.Remove(preset); RaisePropertyChanged(nameof(Presets)); } }
private async void ImportButton_Click(object sender, RoutedEventArgs e) { var file = await IOTools.OpenLocalFile(".guanzhi"); if (file != null) { string text = await FileIO.ReadTextAsync(file); var model = JsonConvert.DeserializeObject <ExportModel>(text); var tipDialog = new ConfirmDialog("导入提醒", $"您将导入用户名为'{model.UserName}'用户的相关配置及历史记录。这会覆盖您目前的配置及记录,是否确认?"); var result = await tipDialog.ShowAsync(); if (result == ContentDialogResult.Primary) { bool importResult = await ExportModel.ImportModel(model); if (importResult) { var closeDialog = new ConfirmDialog("请重启软件", "配置及历史记录已成功导入,现在请关闭软件,重新启动应用", "关闭", "关闭", "还是关闭"); await closeDialog.ShowAsync(); App.Current.Exit(); } } } }
private async void ClearImageCache_btn_Click(object sender, RoutedEventArgs e) { ConfirmDialog dialog = new ConfirmDialog("Clear image cache:", "Do you really want to **delete** all cached images?"); await UiUtils.ShowDialogAsync(dialog); await VIEW_MODEL.ClearImageCacheAsync(dialog.VIEW_MODEL); await imageCacheFolder_fsc.RecalculateFolderSizeAsync(); }
private void OnRemoveListeningCommand(object parameter) { if (SelectedListening == null) { Notify("Please select listening first", NotificationType.Warning); } else { ConfirmDialog dialog = new ConfirmDialog() { HeaderText = "Listening remove confirmation", MessageText = "Do you really want to remove listening: " + SelectedListening.Date.ToShortDateString() + " ?" }; if (dialog.ShowDialog() == true) { bool deleted = dataService.RemoveListening(SelectedListening); if (deleted) { Notify("Listening has been successfully removed", NotificationType.Success); } else { Notify("Can't remove selected listening. See log for details", NotificationType.Error); } LoadListenings(); } } }
private void FindByPassport_Completed(object sender, EventArgs e) { if (context.Donors.Count != 0) { // Нашли донора. donor = context.Donors.ElementAt(0); gridDonor.DataContext = donor; SetTransplantantList(); } else { // Не нашли донора - спрашиваем о добавлении. ConfirmDialog addDonorDialog = new ConfirmDialog("Нет записи с такими данными. Добавить нового донора?", donor); addDonorDialog.Title = "Не найдено"; addDonorDialog.Show(); addDonorDialog.Closed += (s, e1) => { if ((s as ChildWindow).DialogResult == true) { // Добавить нового донора. DonorForm form = new DonorForm(donor); form.Show(); form.Closed += form_Closed; } }; }; }
private IEnumerator RemoveRoutine() { ConfirmDialog dialog = FindObjectOfType <ConfirmDialog>(); dialog.ApplyColours(); dialog.Show(); dialog.SetInfoMessage("Remove '<b>" + nameText.text + "</b>'?"); dialog.SetNone(); while (dialog.IsNone()) { yield return(null); } if (dialog.IsNo() || dialog.IsCancel()) { dialog.Hide(); yield break; } if (dialog.IsYes()) { dialog.Hide(); string url = string.Format("{0}/{1}/close", Endpoints.instance.TODOIST_TASKS(), taskId); UnityWebRequest request = Postman.CreatePostRequest(url, new JSONObject()); request.SetRequestHeader("Authorization", "Bearer " + apiKey); yield return(request.SendWebRequest()); Destroy(this.gameObject); } }
private async void Save_Button_Click(object sender, RoutedEventArgs e) { var confirmDialog = new ConfirmDialog(); var result = await confirmDialog.ShowAsync(); if (result != ContentDialogResult.Primary) { return; } var member = new Member { firstName = firstName.Text, lastName = lastName.Text, password = password.Text, address = address.Text, phone = phone.Text, avatar = _imageUrl, gender = Int32.Parse(gender.Text), email = email.Text, birthday = birthday.Text }; var isValid = true; // validate dữ liệu if (isValid) { Member createdMember = await _memberService.Register(member); } }
private void DeleteDomain() { var children = _view.PnlDomainContainer.Children; for (var i = children.Count - 1; i >= 0; i--) { if (children[i].GetType() == typeof(LDAPDomainExpanderElement)) { var expander = children[i] as LDAPDomainExpanderElement; if (expander.Model.IsActived) { var confirmdialog = new ConfirmDialog("Are you sure you want to delete selected domain?", "CONFIRM DELETE"); confirmdialog.ConfirmText.Text = "Are you sure you want to delete selected domain?"; confirmdialog.BtnOk.Focus(); if (confirmdialog.ShowDialog() == true) { if (!expander.Model.IsNotSaved) { var deleteBg = new BackgroundWorker(); deleteBg.DoWork += DeleteBg_DoWork; deleteBg.RunWorkerAsync(expander.Model.Id); } _view.PnlDomainContainer.Children.RemoveAt(i); ApplicationContext.LDAPList.RemoveAll(r => r.Id == expander.Model.Id); LDAPTreeDataSource = new ObservableCollection <DirectoryNode>(); } break; } } } }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { random = new Random(); // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); this.IsMouseVisible = true; //Global.Content = this.Content; Global.init(this.Content); Config.Instance.Load(); // TODO: use this.Content to load your game content here Global.WINDOW_WIDTH = GraphicsDevice.Viewport.Width; Global.WINDOW_HEIGHT = GraphicsDevice.Viewport.Height; subMenu = new SubMenu(this.GraphicsDevice); resultDialog = new ResultDialog(this.GraphicsDevice); confirmDialog = new ConfirmDialog(this.GraphicsDevice); annouceDialog = new AnnounceDialog(this.GraphicsDevice); inputDialog = new InputTextDialog(this.GraphicsDevice); menu = new Menu(); log = new MissionLog(); music = Global.loadSong(); collect = Global.loadSoundEffect("Collect-sound"); endGame = Global.loadSoundEffect("Game-Over"); Global.ghostSound = Global.loadSoundEffect("Ghost"); Global.zombieSound = Global.loadSoundEffect("Zombie"); //load(currentRow, currentCol, 2, 2, 2, 8); }
private void ResetBomb_Click(object sender, RoutedEventArgs e) { var dialog = ConfirmDialog.YesNoDialog("Confirm Action", "Reset the current bomb?", ConfirmDialog.ExclamationImagePath, ConfirmResetBomb); dialog.Owner = window; dialog.ShowDialog(); }
/// <summary> /// Displays a popup dialog box for users to delete a rule /// </summary> /// <param name="rule"></param> /// <param name="partition"></param> public void OnDeleteRule(ServerRule rule, ServerPartition partition) { ConfirmDialog.Message = string.Format(SR.AdminServerRules_DeleteDialog_AreYouSure, rule.RuleName, partition.AeTitle); ConfirmDialog.MessageType = MessageBox.MessageTypeEnum.YESNO; ConfirmDialog.Data = rule.GetKey(); ConfirmDialog.Show(); }
void AddDialog(int id, bool stackable) { var buttons = new List <IDialogButton>(); buttons.Add(new ConfirmDialogButton("add", "Enqueue")); buttons.Add(new ConfirmDialogButton("stack", "Overlay")); buttons.Add(new ConfirmDialogButton("close", "Close")); var dialog = new ConfirmDialog("Dialog " + id + (stackable ? "(Stackable)": ""), buttons, ConfirmDialogSize.Small); dialog.OnClickAsObservable().Subscribe(b => { switch (b.Id) { case "add": AddDialog(n++, false); break; case "stack": AddDialog(n++, true); break; case "close": dialog.Close(); break; } }).AddTo(this); dialog.Stackable = stackable; _dialogRoot.Enqueue(dialog); }
private async void DeleteLogs_btn_Click(object sender, RoutedEventArgs e) { ConfirmDialog dialog = new ConfirmDialog("Delete logs:", "Do you really want to **delete** all logs?"); await UiUtils.ShowDialogAsync(dialog); await VIEW_MODEL.DeleteLogsAsync(dialog.VIEW_MODEL); await logsFolder_fsc.RecalculateFolderSizeAsync(); }
private void CBAccept_SelectedIndexChanged(object sender, EventArgs e) { var cbb = (ComboBox)sender; var item = ConfirmDialog.GetStatusCodeByName(cbb.SelectedItem.ToString()); SettingsManager.SetSetting("auto-accept", item); }
public override void AnswerRessurectDialog(bool answer) { var action = new ConfirmDialog(1510, answer); action.Send(data, tcpClient); data.PendingRessurectDialog = false; }
private void OnCloseBtnClicked(object sender, EventArgs a) { if (changes) { ResponseType res = ConfirmDialog.Show(symbolLabelDialog, "¿Quieres guardar los cambios?"); if (res == ResponseType.Yes) { List <SymbolLabelInfo> symbols = new List <SymbolLabelInfo>(); foreach (object[] row in symbolLabelsModel) { SymbolLabelInfo info = new SymbolLabelInfo(); info.Symbol = (string)(row[0]); info.Label = (string)(row[1]); symbols.Add(info); } LibraryConfig.Instance.Symbols = symbols; LibraryConfig.Instance.Save(); } } }
public static bool ConfirmDialog(string message) { bool confirm = false; using (ConfirmDialog Dialog = new ConfirmDialog() { Message = message, ForeColor = this.ForeColour, BackColor = this.BackColour, ButtonBackColour = this.ButtonBackColour, ButtonForeColour = this.ButtonForeColour, ButtonFlatStyle = this.ButtonFlatStyle }) { DialogResult dr = Dialog.ShowDialog(); if (dr == DialogResult.Yes) { confirm = true; } else { confirm = false; } } return(confirm); }
private async void ClearButton_Click(object sender, RoutedEventArgs e) { if (!biliVM.CheckAccoutStatus()) { return; } if (ViewLaterCollection.Count == 0) { return; } var dialog = new ConfirmDialog("您确认清空稍后观看记录吗?"); dialog.PrimaryButtonClick += async(_s, _e) => { _e.Cancel = true; dialog.IsPrimaryButtonEnabled = false; dialog.PrimaryButtonText = "清空中..."; bool reuslt = await _account.ClearViewLaterAsync(); if (reuslt) { new TipPopup("清空成功").ShowMessage(); ViewLaterCollection.Clear(); HolderText.Visibility = Visibility.Visible; dialog.Hide(); } else { new TipPopup("清空失败").ShowError(); } dialog.PrimaryButtonText = "确认"; dialog.IsPrimaryButtonEnabled = true; }; await dialog.ShowAsync(); }
private void ConfirmAlbumRemove(int albumID) { IsBusy = true; Task <Album> albumFetchTask = Task.Factory.StartNew <Album>(() => { return(dataService.GetAlbum(albumID)); }, TaskScheduler.Default); Task finishFetchTask = albumFetchTask.ContinueWith((a) => { IsBusy = false; var removingAlbum = a.Result; if (removingAlbum != null) { ConfirmDialog confirm = new ConfirmDialog() { HeaderText = "Remove album confirmation", MessageText = String.Format("Do you really want to delete album {0}? " + "All listenings and tracks will be also removed", removingAlbum.Name) }; if (confirm.ShowDialog() == true) { RemoveAlbumImpl(removingAlbum); } } }, TaskScheduler.FromCurrentSynchronizationContext()); //var album = dataService.GetAlbum(albumID); }
private void OnMenuSelected(Button btn) { if (btn == null) { return; } switch (btn.Name) { case UIConstant.BtnSoftwareAddPackage: DisplayAddOrEditDialog(0); break; case UIConstant.BtnSoftwareEditPackage: var selectedId = ViewList.First(r => r.IsSelected).Id; DisplayAddOrEditDialog(selectedId); break; case UIConstant.BtnSoftwareDeletePackage: var confirmDlg = new ConfirmDialog("Are you sure you want to delete?", "Delete Software"); if (confirmDlg.ShowDialog() == true) { DeleteContent(); } break; } }
public override bool HandleInput() { var originalColor = Console.ForegroundColor; Console.ForegroundColor = ConsoleColor.Black; var exitInputLoop = false; do { var input = GetPlayerInput(); if (input == Inputs.cancel) { var dialog = new ConfirmDialog("Are you sure you want to exit the game?"); dialog.Process(); var result = dialog.DialogResult; Draw(); if (result == ConfirmDialogResult.Yes) { Debug("Exit Game = [Y]"); ScreenResult = new ScreenTransitionResult { FromScreen = ScreenType.MainMenu, ToScreen = ScreenType.None }; return(false); } return(true); } } while (exitInputLoop == false); Console.ForegroundColor = originalColor; return(false); }
void Start() { _confirmDialogButton.OnClickAsObservable().Subscribe(_ => { var dialog = new ConfirmDialog("Are you ok?", ConfirmDialogSize.Minimum); dialog.Stackable = false; _dialogRoot.Enqueue(dialog); }).AddTo(this); _menuDialogButton.OnClickAsObservable().Subscribe(_ => { var content = new MenuDialogContentModel(); content.MenuItems.Add(new MenuDialogItemModel("apple", "Apple")); content.MenuItems.Add(new MenuDialogItemModel("banana", "Banana")); content.MenuItems.Add(new MenuDialogItemModel("tomato", "Tomato")); var dialog = new MenuDialog("Menu", content); dialog.OnClickAsObservable().Subscribe(b => { _dialogRoot.Enqueue(new ConfirmDialog(b.Name, ConfirmDialogSize.Minimum)); dialog.Close(); }).AddTo(this); _dialogRoot.Enqueue(dialog); }).AddTo(this); _stackDialogButton.OnClickAsObservable().Subscribe(_ => { n = 0; AddDialog(n++, true); }).AddTo(this); }
private static void ProcessTown() { var kadalaItem = Kadala.GetSelectedItem(); if (kadalaItem != Kadala.Items.NONE && OpenWindows.IsKadalaNewOpened()) { Kadala.GambleItem(kadalaItem); } if (Smith.ShouldSalvage() && OpenWindows.IsSmithNewOpened()) { Smith.SalvageNormals(); } int urshiUp = Urshi.GetUpgradeCount(); if (urshiUp > 0 && OpenWindows.IsUrshiNewOpened()) { Urshi.Upgrade(urshiUp); } if (Orek.ShouldOpen() && OpenWindows.IsOrekNewOpened()) { Orek.Open(); } if (ConfirmDialog.ShouldAccept() && OpenWindows.IsConfirmDialogNewOpened()) { ConfirmDialog.Accept(); } }
public void DeleteExpenses(Object parameter) { if (ConfirmDialog.Confirm($"Удалить покупку {SelectedExpenses.Name} {SelectedExpenses.Sum} ({SelectedExpenses.Category.Name}) от {SelectedExpenses.Date}?")) { ExpensesSource.Remove(SelectedExpenses); db.SaveChanges(); } }
public void DeletePlanExpenses(Object parameter) { if (ConfirmDialog.Confirm($"Удалить план {SelectedPlanExpenses.Expenses} {SelectedPlanExpenses.Category.Name} ?")) { PlanExpensesSource.Remove(SelectedPlanExpenses); db.PlanExpenses.Local.Remove(SelectedPlanExpenses); db.SaveChanges(); } }
public void DeletePlanIncome(Object parameter) { if (ConfirmDialog.Confirm($"Удалить план {SelectedPlanIncome.Income} {SelectedPlanIncome.Source_of_income.Name} ?")) { PlanIncomeSource.Remove(SelectedPlanIncome); db.PlanIncome.Local.Remove(SelectedPlanIncome); db.SaveChanges(); } }
private void Dispatcher_UnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e) { var page = new ConfirmDialog(); page.Caption = "错误信息"; page.Message = GetInnerException(e.Exception).Message; page.ShowDialog(); e.Handled = true; }
public void DeletePurchase(Object parameter) { if (ConfirmDialog.Confirm($"Удалить покупку {SelectedPurchase.Name}?")) { PurchaseSource.Remove(SelectedPurchase); db.Purchase.Local.Remove(SelectedPurchase); db.SaveChanges(); } }
public void DeleteIncome(Object parameter) { if (ConfirmDialog.Confirm($"Удалить доход {SelectedIncome.Sum} ({SelectedIncome.Source_of_income.Name}) от {SelectedIncome.Date}?")) { db.Income.Local.Remove(SelectedIncome); IncomeSource.Remove(SelectedIncome); db.SaveChanges(); } }
public static async Task <bool> ShowConfirmAsync(string message) { var dialog = new ConfirmDialog() { Header = Messages.HeaderWarning, Content = message }; var task = await DialogHost.Show(dialog); return(task.ToString().Equals("True")); }
private void Start() { Instance = this; // Click listeners. acceptButton.onClick.AddListener(AcceptConfirmDialog); declineButton.onClick.AddListener(CloseConfirmDialog); closeButton.onClick.AddListener(CloseConfirmDialog); // Close UI. CloseConfirmDialog(); }
public void OnlineSignUp() { var dialog = new ConfirmDialog(this.Browser, DialogButton.OK); Manager.Current.DialogMonitor.AddDialog(dialog); Manager.Current.DialogMonitor.Start(); this.Browser.WaitForElement(3000, "id=SignUpOnlineButton"); this.CourseOnlineApply.MouseClick(); ////Thread.Sleep(3000); ////this.Browser.Desktop.KeyBoard.KeyPress(System.Windows.Forms.Keys.Enter); dialog.WaitUntilHandled(); }
private void export_Click(object sender, RoutedEventArgs e) { string dbPath = this.filePath.Text; if (dbPath == null || dbPath.Trim().Equals("")) { this.info.Content = "请选择有效路径!"; return; } //获取文件名,不带路径 string fileNameExt = this.filePath.Text.Substring(this.filePath.Text.LastIndexOf("\\") + 1); fileNameExt.Insert(1, "dameng"); string dir = this.filePath.Text; try { if(File.Exists(dir)) { ConfirmDialog confirm = new ConfirmDialog("导出数据","当前路径已经存在同名文件,要覆盖吗?"); if(confirm.ShowDialog() == true) { this.info.Content = "正在导出文件到" + dir + " ......"; System.IO.File.Copy(AppDomain.CurrentDomain.BaseDirectory + "/data/ETTS_test.db", dir,true); this.info.Content = "文件已经导出到" + dir + " !"; } } else { this.info.Content = "正在导出文件到" + dir + " ......"; System.IO.File.Copy(AppDomain.CurrentDomain.BaseDirectory + "/data/ETTS_test.db", dir); this.info.Content = "文件已经导出到" + dir + " !"; } } catch (Exception) { Message msg = new Message("导出数据", "导出文件出错!"); msg.ShowDialog(); } //fs.Close(); }
public void L1T01_CreateAndSearchWrestler() { var lastName = String.Format("Burton{0}{1}t{2}", DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Millisecond); var firstName = "Cliff"; var dateOfBirth = "10-02-1962"; var middleName = "Lee"; var region1 = "Vynnitska"; var region2 = "Volynska"; var fst1 = "Dinamo"; var fst2 = "Kolos"; var trainer1 = "Trainer1 T.T."; var trainer2 = "Trainer2 T.T."; var style = "FW"; var age = "Senior"; var year = "2016"; var card = "Produced"; var lastNameUp = String.Format("Hetfield{0}{1}t{2}", DateTime.Now.Month, DateTime.Now.Day, DateTime.Now.Millisecond); var firstNameUp = "James"; var dateOfBirthUp = "03-08-1963"; var middleNameUp = "Alan"; var region1Up = "Lvivska"; var region2Up = "Odeska"; var fst1Up = "MON"; var fst2Up = "ZSU"; var trainer1Up = "Trainer2 T.T."; var trainer2Up = "Trainer1 T.T."; var styleUp = "GR"; var ageUp = "Cadet"; var yearUp = "2014"; var cardUp = "Recieved"; // >>> create wrestler var mainPage = new MainPage(); //click New Wrestler button mainPage.NewButton.Click(); //fill all fields var wrestlerProperties = new WrestlerProperties(); wrestlerProperties.LastName.Text = lastName; wrestlerProperties.FirstName.Text = firstName; wrestlerProperties.DateOfBirth.Text = dateOfBirth; wrestlerProperties.MiddleName.Text = middleName; wrestlerProperties.Region1.SelectByText(region1); wrestlerProperties.Region2.SelectByText(region2); wrestlerProperties.FST1.SelectByText(fst1); wrestlerProperties.FST2.SelectByText(fst2); wrestlerProperties.Trainer1.Text = trainer1; wrestlerProperties.Trainer2.Text = trainer2; wrestlerProperties.Style.SelectByText(style); wrestlerProperties.Age.SelectByText(age); wrestlerProperties.Year.SelectByText(year); wrestlerProperties.Card.SelectByText(card); //save wrestler wrestlerProperties.SuccessButton.Click(); Assert.That(false == wrestlerProperties.SuccessButton.Enabled, "Wrestler was not saved."); wrestlerProperties.Ribbon.CloseCurrentTab(); //search wrestler mainPage.SearchCondition.Text = lastName; mainPage.SearchButton.Click(); Assert.That(0 < mainPage.SearchResults.Count, "Wrestler was not found."); Assert.That( String.Format("{0} {1} {2}", lastName, firstName, middleName) == mainPage.SearchResults.Rows[0].FIO, "Wrestler was not found."); var id = mainPage.SearchResults.Rows[0].ID; try { mainPage.SearchResults.Rows[0].Select(); wrestlerProperties = new WrestlerProperties(); //verify fields var exceptions = new List<string>(); if (lastName != wrestlerProperties.LastName.Text) exceptions.Add("Last name is wrong."); if (firstName != wrestlerProperties.FirstName.Text) exceptions.Add("First name is wrong."); if (dateOfBirth != wrestlerProperties.DateOfBirth.Text) exceptions.Add("Date of Birth is wrong."); if (middleName != wrestlerProperties.MiddleName.Text) exceptions.Add("Middle name is wrong."); if (region1 != wrestlerProperties.Region1.Selected) exceptions.Add("Region1 is wrong."); if (region2 != wrestlerProperties.Region2.Selected) exceptions.Add("Region2 is wrong."); if (fst1 != wrestlerProperties.FST1.Selected) exceptions.Add("FST1 is wrong."); if (fst2 != wrestlerProperties.FST2.Selected) exceptions.Add("FST1 is wrong."); if (trainer1 != wrestlerProperties.Trainer1.Text) exceptions.Add("Trainer1 is wrong."); if (trainer2 != wrestlerProperties.Trainer2.Text) exceptions.Add("Trainer2 is wrong."); if (style != wrestlerProperties.Style.Selected) exceptions.Add("Style is wrong."); if (age != wrestlerProperties.Age.Selected) exceptions.Add("Age is wrong."); if (year != wrestlerProperties.Year.Selected) exceptions.Add("Year is wrong."); if (card != wrestlerProperties.Card.Selected) exceptions.Add("Card is wrong."); //update wrestler wrestlerProperties.LastName.Text = lastNameUp; wrestlerProperties.FirstName.Text = firstNameUp; wrestlerProperties.DateOfBirth.Text = dateOfBirthUp; wrestlerProperties.MiddleName.Text = middleNameUp; wrestlerProperties.Region1.SelectByText(region1Up); wrestlerProperties.Region2.SelectByText(region2Up); wrestlerProperties.FST1.SelectByText(fst1Up); wrestlerProperties.FST2.SelectByText(fst2Up); wrestlerProperties.Trainer1.Text = trainer1Up; wrestlerProperties.Trainer2.Text = trainer2Up; wrestlerProperties.Style.SelectByText(styleUp); wrestlerProperties.Age.SelectByText(ageUp); wrestlerProperties.Year.SelectByText(yearUp); wrestlerProperties.Card.SelectByText(cardUp); //save wrestler wrestlerProperties.SuccessButton.Click(); wrestlerProperties.Ribbon.CloseCurrentTab(); //search and open updated wrestler SearchWrestler(lastNameUp, mainPage); mainPage.SearchResults.Rows[0].Select(); wrestlerProperties = new WrestlerProperties(); //verify fields if (lastNameUp != wrestlerProperties.LastName.Text) exceptions.Add("Updated Last name is wrong."); if (firstNameUp != wrestlerProperties.FirstName.Text) exceptions.Add("Updated First name is wrong."); if (dateOfBirthUp != wrestlerProperties.DateOfBirth.Text) exceptions.Add("Updated Date of Birth is wrong."); if (middleNameUp != wrestlerProperties.MiddleName.Text) exceptions.Add("Updated Middle name is wrong."); if (region1Up != wrestlerProperties.Region1.Selected) exceptions.Add("Updated Region1 is wrong."); if (region2Up != wrestlerProperties.Region2.Selected) exceptions.Add("Updated Region2 is wrong."); if (fst1Up != wrestlerProperties.FST1.Selected) exceptions.Add("Updated FST1 is wrong."); if (fst2Up != wrestlerProperties.FST2.Selected) exceptions.Add("Updated FST1 is wrong."); if (trainer1Up != wrestlerProperties.Trainer1.Text) exceptions.Add("Updated Trainer1 is wrong."); if (trainer2Up != wrestlerProperties.Trainer2.Text) exceptions.Add("Updated Trainer2 is wrong."); if (styleUp != wrestlerProperties.Style.Selected) exceptions.Add("Updated Style is wrong."); if (ageUp != wrestlerProperties.Age.Selected) exceptions.Add("Updated Age is wrong."); if (yearUp != wrestlerProperties.Year.Selected) exceptions.Add("Updated Year is wrong."); if (cardUp != wrestlerProperties.Card.Selected) exceptions.Add("Updated Card is wrong."); //delete wrestler wrestlerProperties.DeleteButton.Click(); var confirmDialog = new ConfirmDialog(); confirmDialog.YesButton.Click(); //check wrestler was deleted if (API.SearchWrestlers(id).Count != 0) exceptions.Add("Wrestler was not deleted."); Assert.That(exceptions.Count == 0, String.Join("\r\n", exceptions.ToArray())); } finally { API.DeleteWrestler(id); } }