protected override void OnStart(string[] args) { this.EventLog.WriteEntry("Uygulama Args:" + String.Join(",", args), EventLogEntryType.Warning); this.EventLog.WriteEntry("Uygulama Başladı Ayar Dosyası:" + ayarDosyasi); ayarProvider = new AyarProvider(ayarDosyasi); GorevList = ayarProvider.GorevList.ToList().Select(x => new Gorev { AcilisZamani = x.AcilisZamani, Calisiyor = null, AktifGunler = x.AktifGunler, KapanisZamani = x.KapanisZamani, OncesiniKapat = x.OncesiniKapat, Parametreler = x.Parametreler, Sira = x.Sira, Ad = x.Ad, Uygulama = x.Uygulama }).ToList(); this.EventLog.WriteEntry("Görev Sayısı:" + GorevList.Count().ToString()); if (GorevList.Count() > 0) { timer = new Timer(); timer.Elapsed += new ElapsedEventHandler(TimerTick); timer.AutoReset = true; timer.Enabled = true; timer.Interval = 1000; timer.Start(); this.EventLog.WriteEntry("Zamanlayıcı Başladı."); } }
private void Form1_Load(object sender, EventArgs e) { ayarProvider = new AyarProvider(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\ZamanlanmisGorevAyar.json"); GorevListesiYukle(); //GorevList = ayarProvider.GorevList; //GorevList.Add(new Common.Model.Gorev //{ // Uygulama = @"C:\Program Files (x86)\Mozilla Firefox\firefox.exe", // Ad = "Firefox", // Parametreler = "google.com", // AcilisZamani = new TimeSpan(9, 0, 0), // KapanisZamani = new TimeSpan(22, 0, 0), // OncesiniKapat = true, // Sira = 1 //}); //ayarProvider.GorevList = GorevList; // UygulamaKontrol.UygulamaKapat(@"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"); //ayarProvider.GorevList = GorevList; GorevPanelVeriYukle(); gorevTakibi.Basla(); button1.Text = "Durdur"; }