private void NewCategoryMenuItem_Click(object sender, EventArgs e) { using (var nameInputForm = new NameInputForm()) { nameInputForm.Text = "New Category"; if (nameInputForm.ShowDialog(this) == DialogResult.OK) { var menuItem = this.AddRatingCategoryMenuItem(nameInputForm.SelectedName); menuItem.PerformClick(); } } }
private void AddCategoryMenuItem_Click(object sender, EventArgs e) { var tabIndex = this.tabContextMenu.Tag as int?; using (var nameInputForm = new NameInputForm()) { nameInputForm.Text = "New Category"; if (nameInputForm.ShowDialog(this) == DialogResult.OK) { // TODO: Append after the right-clicked tab. this.AppendNewTab(nameInputForm.SelectedName); // TODO: Enusure it is unique, etc. } } }
private void RenameMenuItem_Click(object sender, EventArgs e) { var tabIndex = this.tabContextMenu.Tag as int?; var tabPage = this.rulePages.TabPages[tabIndex.Value]; using (var nameInputForm = new NameInputForm()) { nameInputForm.Text = "Rename Category"; nameInputForm.SelectedName = tabPage.Text; if (nameInputForm.ShowDialog(this) == DialogResult.OK) { tabPage.Text = nameInputForm.SelectedName; // TODO: Enusure it is unique, etc. } } }
private async void SaveThisSearchMenuItem_Click(object sender, EventArgs e) { var searchText = this.searchBox.Text; using (var nameInputForm = new NameInputForm()) { nameInputForm.Text = "Save Search"; if (nameInputForm.ShowDialog(this) == DialogResult.OK) { var savedSearch = await this.index.AddSavedSearch(nameInputForm.SelectedName, searchText).ConfigureAwait(true); this.AddSavedSearchMenuItem(savedSearch); } } }