Beispiel #1
0
 private void StorageServiceButtton_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         if (StorageServiceHelper.CurrentStatus() != ServiceControllerStatus.Running)
         {
             StorageServiceHelper.StartService(startStopComletionCallback);
         }
         else
         {
             StorageServiceHelper.StopService(startStopComletionCallback);
         }
         DisplayCurrentServiceStatus();
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Beispiel #2
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     if (StorageServiceHelper.IsInstalled() != true)
     {
         StorageServiceStateTextBlock.Text = "not installed";
         StorageServiceButtton.IsEnabled   = false;
     }
     else
     {
         /*storageServiceStatusCheck = new DispatcherTimer();
          * storageServiceStatusCheck.Tick += OnCheckDriveServiceStatus;
          * storageServiceStatusCheck.Interval = TimeSpan.FromSeconds(10);
          * storageServiceStatusCheck.Start();
          * DisplayCurrentServiceStatus();
          * StorageServiceButtton.IsEnabled = true;
          * if (StorageServiceHelper.CurrentStatus() == ServiceControllerStatus.Running)*/
         TryToEstablishPipeConnection();
     }
 }
Beispiel #3
0
 private void DisplayCurrentServiceStatus()
 {
     try
     {
         var status = StorageServiceHelper.CurrentStatus();
         StorageServiceStateTextBlock.Text = status.ToString();
         if (status == ServiceControllerStatus.Stopped)
         {
             StorageServiceButtton.Background = notActive;
         }
         else
         {
             StorageServiceButtton.Background = active;
         }
     }
     catch (System.Exception ex)
     {
         MessageBox.Show(ex.Message.ToString());
         storageServiceStatusCheck.Stop();
     }
 }