Ejemplo n.º 1
0
 private void Remove_Item_Click(object sender, RoutedEventArgs e)
 {
     if (ListView.SelectedIndex >= 0)
     {
         Snippets.List.RemoveAt(ListView.SelectedIndex);
         Snippets.Serialize();
     }
 }
Ejemplo n.º 2
0
 private void Save_Click(object sender, RoutedEventArgs e)
 {
     if (!String.IsNullOrEmpty(Command.Text) && !String.IsNullOrEmpty(Substitutor_title.Text))
     {
         Snippets.List[index].Command          = Command.Text;
         Snippets.List[index].SubstitutorTitle = Substitutor_title.Text;
         Snippets.List[index].ExtraArgs        = Extra_args.Text;
         Snippets.Serialize();
         Close();
     }
     else if (String.IsNullOrEmpty(Command.Text) && !String.IsNullOrEmpty(Substitutor_title.Text))
     {
         MessageBox.Show("Command cannot be left empty!");
     }
     else if (!String.IsNullOrEmpty(Command.Text) && String.IsNullOrEmpty(Substitutor_title.Text))
     {
         MessageBox.Show("Substitutor Title cannot be left empty!");
     }
     else
     {
         MessageBox.Show("Command and Substitutor Title both must be filled!");
     }
 }