Exemple #1
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            // if we get "app" as command line argument then run this as standalone app instead of service (just for testing)
            if (args.Length > 0 && args[0] == "app")
            {
                BillingProcessor bp = new BillingProcessor();
                bp.Initialize();
                System.Windows.Forms.MessageBox.Show("Click OK to close this app");
                bp.Dispose();
            }
            else  // Run as Windows Service
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[] 
			                                    { 
				                                    new BillingService() 
			                                    };
                ServiceBase.Run(ServicesToRun);
            }
        }
Exemple #2
0
 protected override void OnStart(string[] args)
 {
     _processor = new BillingProcessor();
     _processor.Initialize();
 }