/// <summary> /// Start this service. /// </summary> protected override void OnStart(string[] args) { Logger logger = LogManager.GetCurrentClassLogger(); // logger.Info(args.Length); // foreach (var str in args) { // logger.Info(str); // } string[] imagePathArgs = Environment.GetCommandLineArgs(); foreach (var str in imagePathArgs) { logger.Debug(str); } Directory.SetCurrentDirectory(imagePathArgs[1]); //th = new Thread(new ThreadStart(StartService)); //th.Start(); _service.LoadSettings(); string result = _service.StartService(); _service.StartSheduler(); logger.Info(result); }
private void StartService() { Logger logger = LogManager.GetCurrentClassLogger(); Func <string, int> AddStr = str => report.Items.Add(str); string result = _service.StartService(); _service.StartSheduler(); report.Invoke(AddStr, result); }