Start() public method

public Start ( string args ) : void
args string
return void
Ejemplo n.º 1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            bool console = false;
            var  p       = new FluentCommandLineParser();

            p.Setup <bool>('c', "console").Callback(c => console = c);
            p.Parse(args);

            if (console)
            {
                var service = new Service();
                service.Start(args);
                Console.ReadLine();
                service.Stop();
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                {
                    new Service()
                };
                ServiceBase.Run(ServicesToRun);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            bool console = false;
            var p = new FluentCommandLineParser();
            p.Setup<bool>('c', "console").Callback(c => console = c);
            p.Parse(args);

            if (console)
            {
                var service = new Service();
                service.Start(args);
                Console.ReadLine();
                service.Stop();
            }
            else
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
			    { 
				    new Service() 
			    };
                ServiceBase.Run(ServicesToRun);
            }
        }