private void timer1_Tick(object sender, ElapsedEventArgs e) { changes.Clear(); AdminData data = AdminData.ReadData(); timer1.Interval = data.time; WriteErrorLog("Service erfolgreich durchgeführt!"); changes = HardwareConf.CheckDifferences(); if (isChanged == true) { HardwareConf.WriteEmail(); HardwareConf.WriteConfig(); } }
protected override void OnStart(string[] args) { AdminData data = AdminData.ReadData(); HardwareConf conf = new HardwareConf(); if (!File.Exists(confPath)) { HardwareConf.WriteConfig(); } changes = HardwareConf.CheckDifferences(); if (isChanged == true) { HardwareConf.WriteEmail(); } timer1 = new Timer(); this.timer1.Interval = data.time; /*Intervall in der Service ausgeführt wird, durch Editor änderbar */ this.timer1.Elapsed += new System.Timers.ElapsedEventHandler(this.timer1_Tick); timer1.Enabled = true; WriteErrorLog("Hardware-Service wurde gestartet."); }