Ejemplo n.º 1
0
        static void Main()
        {
            Debug.WriteLine("Running WindowsService.Main");
            Debug.WriteLine(Directory.GetCurrentDirectory());

            RunUI();

            if (ohipsMonitor == null)
            {
                // Start our monitor thread
                ohipsMonitor = new OhipsMonitor();
                Thread oThread = new Thread(new ThreadStart(ohipsMonitor.OhipsMonitorThread));

                // Start the thread
                oThread.Start();

                // Spin for a while waiting for the started thread to become
                // alive:
                while (!oThread.IsAlive)
                {
                    ;
                }
            }

            // Start service
            ServiceBase.Run(new WindowsService());
        }
Ejemplo n.º 2
0
 /// <summary>
 /// OnStop(): Put your stop code here
 /// - Stop threads, set final data, etc.
 /// </summary>
 protected override void OnStop()
 {
     System.Diagnostics.Debug.WriteLine("OpenHIPS Stop");
     running = false;
     OhipsMonitor.Uninstall();
     KillUI();
     base.OnStop();
 }
Ejemplo n.º 3
0
        static void Main()
        {
            Debug.WriteLine("Running WindowsService.Main");
            Debug.WriteLine(Directory.GetCurrentDirectory());

            RunUI();

            if (ohipsMonitor == null)
            {
                // Start our monitor thread
                ohipsMonitor = new OhipsMonitor();
                Thread oThread = new Thread(new ThreadStart(ohipsMonitor.OhipsMonitorThread));

                // Start the thread
                oThread.Start();

                // Spin for a while waiting for the started thread to become
                // alive:
                while (!oThread.IsAlive) ;
            }

            // Start service
            ServiceBase.Run(new WindowsService());
        }