예제 #1
0
 private Boolean CloseingPreventionChecking()
 {
     if (ServiceAdapter.GetServiceStatus("GUIAdapter") == "Running")
     {
         CloseingPreventionStatusLabel.Text      = "פעיל";
         CloseingPreventionStatusLabel.ForeColor = Color.LimeGreen;
         return(true);
     }
     else
     {
         CloseingPreventionStatusLabel.Text      = "לא פעיל";
         CloseingPreventionStatusLabel.ForeColor = Color.Red;
         ServiceAdapter.StartService("GUIAdapter", 10000);
         return(false);
     }
 }
예제 #2
0
 private void CloseingPreventionStatusLabel_Click(object sender, EventArgs e)
 {
     if (CloseingPreventionChecking() == false)
     {
         try
         {
             string servicePath = (System.Reflection.Assembly.GetExecutingAssembly().CodeBase).Replace("file:///", "").Replace("MMB-Filter.exe", "MMB-Service.exe");
             MessageBox.Show(servicePath.Replace("MMB-Filter.exe", "MMB - Service.exe") + "    ," + File.Exists(servicePath));
             ServiceAdapter.InstallService(servicePath);
             ServiceAdapter.StartService("GUIAdapter", 10000);
         }
         catch
         {
             MessageBox.Show("לא ניתן להתקין תוסף שירות");
         }
     }
 }