예제 #1
0
 private void saveListToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (Settings.CurrentFileName == "")
     {
         if (lstList.Items.Count > 0)
         {
             frmInput fi = new frmInput();
             fi.Caption = Settings.ApplicationName;
             fi.Label   = "Please enter list name";
             if (fi.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
                 Settings.CurrentFileName = fi.Value;
                 if (Settings.Names.IndexOf(Settings.CurrentFileName) < 0)
                 {
                     Settings.Names.Add(Settings.CurrentFileName);
                 }
                 SaveConfig();
                 SaveWordsToFile();
                 isFileSaved = true;
             }
         }
         else
         {
             MessageBox.Show("Nothing to Save");
         }
     }
     else
     {
         SaveWordsToFile();
         isFileSaved = true;
     }
 }
예제 #2
0
 private void editToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (lstList.SelectedItems.Count > 0)
     {
         string   tmpselectedstring = lstList.SelectedItem.ToString();
         int      index             = lstList.SelectedIndex;
         frmInput fi = new frmInput();
         fi.Caption = Settings.ApplicationName + "-" + tmpselectedstring;
         fi.Label   = "Change Text";
         fi.Value   = tmpselectedstring;
         if (fi.ShowDialog() == System.Windows.Forms.DialogResult.OK)
         {
             lstList.Items[lstList.SelectedIndex] = fi.Value;
             SaveWordsToFile();
         }
     }
 }