protected override void OnStart(string[] args) { Logger.Info("onStart"); try { isFocusKnotData = false; fusionDataService = new FusionDataService(_fusionConnectionString); KnotDataService = new KnotDataService(_knotConnectionString); exportService = new ExportService(); ComPort.DataReceived += new SerialDataReceivedEventHandler(onComport_DataReceived); } catch (Exception ex) { Logger.Error(ex, "onStart KnotService"); Logger.Error(ex.Message); Logger.Error(ex.StackTrace); throw; } timer = new Timer(); timer.Interval = 10000; // 60 seconds timer.Elapsed += new ElapsedEventHandler(this.OnTimer); timer.Start(); }
public Report() { InitializeComponent(); _connectionString = ConfigurationManager.AppSettings.Get("KnotConnectionString"); _operationService = new KnotDataService(_connectionString); }