Ejemplo n.º 1
0
 protected override void OnStop()
 {
     this.Trace("service is stopping...");
     //
     if (null != this.usbMonitor)
     {
         this.usbMonitor.Stop();
         this.usbMonitor.Dispose();
         this.usbMonitor = null;
     }
     this.OleUninitialize();
     //
     this.Trace("...service has stopped");
 }
Ejemplo n.º 2
0
 protected override void OnStart(string[] args)
 {
     this.Trace("service is starting...");
     //
     try {
         WIN32.OleInitialize(IntPtr.Zero);
         this.oleInitialized = true;
         //
         this.usbMonitor = new USBMonitor(this, this, this.ServiceHandle, true);
         this.usbMonitor.AddDeviceInterfaceOfInterest(AndroidADBDeviceInterface);
         this.usbMonitor.Start();
     }
     catch (Exception e)
     {
         this.ExitCode = WIN32.ERROR_EXCEPTION_IN_SERVICE;
         this.ServiceSpecificExitCode = WIN32.Win32ErrorFromException(e);
         this.Trace($"exception: {e}");
         throw;
     }
     //
     this.Trace("...service has started");
 }
Ejemplo n.º 3
0
 protected override void OnStop()
 {
     this.Trace("service is stopping...");
     //
     if (null != this.usbMonitor)
         {
         this.usbMonitor.Stop();
         this.usbMonitor.Dispose();
         this.usbMonitor = null;
         }
     this.OleUninitialize();
     //
     this.Trace("...service has stopped");
 }
Ejemplo n.º 4
0
 protected override void OnStart(string[] args)
 {
     this.Trace("service is starting...");
     //
     try {
         WIN32.OleInitialize(IntPtr.Zero);
         this.oleInitialized = true;
         //
         this.usbMonitor = new USBMonitor(this, this, this.ServiceHandle, true);
         this.usbMonitor.AddDeviceInterfaceOfInterest(AndroidADBDeviceInterface);
         this.usbMonitor.Start();
         }
     catch (Exception e)
         {
         this.ExitCode = WIN32.ERROR_EXCEPTION_IN_SERVICE;
         this.ServiceSpecificExitCode = WIN32.Win32ErrorFromException(e);
         this.Trace($"exception: {e}");
         throw;
         }
     //
     this.Trace("...service has started");
 }