Exemplo n.º 1
0
 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();
         }
     }
 }
Exemplo n.º 2
0
 public static bool Execute(SunfishServiceConfiguration ssc)
 {
     using (FServiceConf f = new FServiceConf())
     {
         f.ssc = ssc;
         f.LoadData();
         return(f.ShowDialog() == DialogResult.OK);
     }
 }