コード例 #1
0
ファイル: Program.cs プロジェクト: IdeaFortune/Monaco
        /// <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);
            }
        }
コード例 #2
0
ファイル: BillingService.cs プロジェクト: IdeaFortune/Monaco
 protected override void OnStart(string[] args)
 {
     _processor = new BillingProcessor();
     _processor.Initialize();
 }