예제 #1
0
        static void Main(string[] args)
        {
            try
            {
                WatchTowerDaemon daemon = new WatchTowerDaemon();

                if (args != null && args.Length == 1 && args[0].StartsWith("-c"))
                {
                    Console.WriteLine("WatchTower starting");

                    Thread daemonThread = new Thread(daemon.Start);
                    daemonThread.Start();

                    m_watchTowerUp.WaitOne();
                }
                else
                {
                    System.ServiceProcess.ServiceBase[] ServicesToRun;
                    ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service(daemon) };
                    System.ServiceProcess.ServiceBase.Run(ServicesToRun);
                }
            }
            catch (Exception excp)
            {
                Console.WriteLine("Exception Main. " + excp.Message);
            }
        }
        static void Main(string[] args)
        {
            try
            {
                WatchTowerDaemon daemon = new WatchTowerDaemon();

                if (args != null && args.Length == 1 && args[0].StartsWith("-c"))
                {
                    Console.WriteLine("WatchTower starting");

                    Thread daemonThread = new Thread(daemon.Start);
                    daemonThread.Start();

                    m_watchTowerUp.WaitOne();
                }
                else
                {
                    System.ServiceProcess.ServiceBase[] ServicesToRun;
                    ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service(daemon) };
                    System.ServiceProcess.ServiceBase.Run(ServicesToRun);
                }
            }
            catch (Exception excp)
            {
                Console.WriteLine("Exception Main. " + excp.Message);
            }
        }
예제 #3
0
 public Service(WatchTowerDaemon daemon)
 {
     this.CanShutdown = true;
     this.CanStop     = true;
     m_daemon         = daemon;
 }
예제 #4
0
        public Service(WatchTowerDaemon daemon)
		{
			this.CanShutdown = true;
			this.CanStop = true;
            m_daemon = daemon;
		}