Exemplo n.º 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        ///
        public static void Main(params string[] args)
        {
            using (var mutex = new Mutex(false, "Global\\" + WorkerName))
            {
                if (!mutex.WaitOne(0, false))
                {
                    Log.Debug("{0} is already running. Only a single instance allowed.", WorkerName);
                    return;
                }

                var arg0 = string.Empty;
                if (args.Length > 0)
                {
                    arg0 = (args[0] ?? string.Empty).ToLower();
                }

                var service = new Raiden();
                if (arg0 == "-console")
                {
                    FakeService(service, args);
                    return;
                }

                var servicesToRun = new ServiceBase[] { new Raiden() };
                ServiceBase.Run(servicesToRun);
            }
        }
Exemplo n.º 2
0
 public static void FakeService(Raiden service, params string[] args)
 {
     service.Start(args);
     Console.ReadLine();
 }