private void EditConfiguration(SunfishServiceConfiguration ssc, SunfishService oldService) { if (FServiceConf.Execute(ssc)) { try { if (oldService == null) { lbPaths.Items.Add(Sunfish.AddService(ssc)); } else { SunfishService s = Sunfish.ReplaceService(oldService, ssc); int idx = lbPaths.Items.IndexOf(oldService); if (idx < 0) { lbPaths.Items.Add(s); } else { lbPaths.Items[idx] = s; } } } catch (Exception ex) { ex.Show(); } } }
private void Form1_FormClosed(object sender, FormClosedEventArgs e) { try { Sunfish.Save(); } catch { }; Sunfish.Active = false; }
private void btSub_Click(object sender, EventArgs e) { SunfishService sh = (SunfishService)lbPaths.SelectedItem; if (sh == null) { return; } if (MessageBox.Show("Delete access " + sh.Configuration.Name + "? Can not be undone!", "Delete", MessageBoxButtons.YesNo) == DialogResult.Yes) { Sunfish.DeleteService(sh); lbPaths.Items.Remove(sh); } }