public static getFirstKeywordList ( ) : string | ||
return | string |
private void deleteListButton_Click(object sender, EventArgs e) { if (Program.Keys.KeywordDict.Count < 2) { MessageBox.Show("You cannot delete the last list!"); return; } string message = "Are you sure you want to delete the List " + keywordListsBox.SelectedItem.ToString() + "?"; string caption = "Delete List " + keywordListsBox.SelectedItem.ToString(); MessageBoxButtons buttons = MessageBoxButtons.YesNo; DialogResult result; result = MessageBox.Show(message, caption, buttons); if (result == DialogResult.No) { MessageBox.Show("Canceled"); return; } if (Program.Keys.KeywordDict.ContainsKey(keywordListsBox.SelectedItem.ToString())) { Program.Keys.KeywordDict.Remove(keywordListsBox.SelectedItem.ToString()); } CurrentEditingList = KeywordCollection.getFirstKeywordList(); KeywordGrid.Rows.Clear(); addKeywordsToGrid(); buildListBox(); this.Text = "Keyword List - " + CurrentEditingList; }
private void addKeywordsToGrid() { if (Program.Keys.KeywordDict.ContainsKey(CurrentEditingList) == false) { CurrentEditingList = KeywordCollection.getFirstKeywordList(); } foreach (string KeywordText in Program.Keys.KeywordDict[CurrentEditingList]) { object[] KeywordObject = new object[] { KeywordText.ToString(), CurrentEditingList.ToString() }; KeywordGrid.Rows.Add(KeywordObject); } }