コード例 #1
0
 public void Restart()
 {
     if (OculusUtil.IsElevated)
     {
         Stop();
         Start();
     }
     else
     {
         _temporaryStatus = ServiceControllerStatus.StartPending;
         OculusUtil.ElevateMe(RestartCommand, true);
         _temporaryStatus = null;
     }
 }
コード例 #2
0
 public void Stop()
 {
     if (OculusUtil.IsElevated)
     {
         _service.Stop();
         _service.WaitForStatus(ServiceControllerStatus.Stopped);
     }
     else
     {
         _temporaryStatus = ServiceControllerStatus.StopPending;
         OculusUtil.ElevateMe(StopCommand, true);
         _temporaryStatus = null;
     }
 }