getFirstKeywordList() public static méthode

public static getFirstKeywordList ( ) : string
Résultat string
Exemple #1
0
        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;
        }
Exemple #2
0
 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);
     }
 }