static void Main() { bool uiMode = false; string[] commandLineArguments = Environment.GetCommandLineArgs(); if (commandLineArguments.Length == 2) { if (commandLineArguments[1].ToLower().Contains("ui")) { uiMode = true; } } if (uiMode) { BackgroundWorkerService.Service.Service executor = new BackgroundWorkerService.Service.Service(); System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.Run(new UserInterface(executor, true)); } else { ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new BackgroundWorkerService.Service.Service() }; ServiceBase.Run(ServicesToRun); } }
static void Main() { bool uiMode = false; string[] commandLineArguments = Environment.GetCommandLineArgs(); if (commandLineArguments.Length == 2) { if (commandLineArguments[1].ToLower().Contains("ui")) { uiMode = true; } } try { if (uiMode) { System.Windows.Forms.Application.ThreadException += new System.Threading.ThreadExceptionEventHandler(Application_ThreadException); BackgroundWorkerService.Service.Service executor = new BackgroundWorkerService.Service.Service(); System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); System.Windows.Forms.Application.Run(new UserInterface(executor, true)); } else { System.AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException); ServiceBase[] ServicesToRun; ServicesToRun = new ServiceBase[] { new BackgroundWorkerService.Service.Service() }; ServiceBase.Run(ServicesToRun); } } catch (Exception ex) { LogUnhandledException(ex); } }
internal AccessPoint(BackgroundWorkerService.Service.Service serviceInstance) { jobManager = serviceInstance.WorkerService.JobManager; this.serviceInstance = serviceInstance; this.serviceInstance.WorkerService.Notify += new EventHandler <NotificationEventArgs>(WorkerService_Notify); }
public UserInterface(BackgroundWorkerService.Service.Service windowsService, bool exitButtonVisible) { InitializeComponent(); this.backgroundWorkerService = windowsService.WorkerService; btnForceExit.Visible = exitButtonVisible; }