示例#1
0
 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();
         }
     }
 }
示例#2
0
        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.
                }
            }
        }
示例#3
0
        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.
                }
            }
        }
示例#4
0
        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);
                }
            }
        }