Exemplo n.º 1
0
 private void addServiceBtn_Click(object sender, EventArgs e) {
     using (var f = new AddEditServiceForm()) {
         var result = f.ShowDialog();
         if (f.DialogResult != DialogResult.OK || f.Service == null) {
             return;
         }
         this.servicesListBox.Items.Add(f.Service);
         SaveConfiguration();
     }
 }
Exemplo n.º 2
0
 void EditServiceByListIndex(int index) {
     var service = (Service)this.servicesListBox.Items[index];
     using (var f = new AddEditServiceForm(service)) {
         var result = f.ShowDialog();
         if (f.DialogResult != DialogResult.OK) {
             return;
         }
         this.servicesListBox.Items[index] = f.Service;
         SaveConfiguration();
     }
 }