Exemplo n.º 1
0
 private void StopService_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     ManageService ms = new ManageService();
     e.CanExecute = ms.ServiceIsExisted(ms.GetServiceName(servicesHost)) && ms.GetServiceStatus(ms.GetServiceName(servicesHost)) == ServiceControllerStatus.Running;
 }
Exemplo n.º 2
0
 private void UnInstalService_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         ManageService ms = new ManageService();
         ms.UnInstallService(servicesHost);
     }
     catch (Exception ex)
     {
         ModernDialog.ShowMessage(ex.Message, "消息", MessageBoxButton.OK);
     }
 }
Exemplo n.º 3
0
 private void StopService_Executed(object sender, ExecutedRoutedEventArgs e)
 {
     try
     {
         ManageService ms = new ManageService();
         string serviceName = ms.GetServiceName(servicesHost);
         ms.StopService(serviceName);
     }
     catch (Exception ex)
     {
         ModernDialog.ShowMessage(ex.Message, "消息", MessageBoxButton.OK);
     }
 }
Exemplo n.º 4
0
 private void UnInstalService_CanExecute(object sender, CanExecuteRoutedEventArgs e)
 {
     ManageService ms = new ManageService();
     e.CanExecute = ms.ServiceIsExisted(ms.GetServiceName(servicesHost));
 }