private void trackBar1_Scroll(object sender, EventArgs e) { int Value = -1; Optimizasyon.Delagate(trackBar1, () => { Value = trackBar1.Value; }); Delegates.Text.Set(lblZamanAsimi, string.Format("{0} saniye", Value.ToString())); }
public void SetDurum(Durum value) { durum = value; Optimizasyon.Delagate(pBox, () => { switch (value) { case Durum.None: pBox.Image = null; break; case Durum.Aktif: pBox.Image = Properties.Resources.tick_box_24px; break; case Durum.Pasif: pBox.Image = Properties.Resources.close_window_24px; break; case Durum.Yukleniyor: pBox.Image = Properties.Resources.loading; break; default: break; } }); }
private void btnSave_Click(object sender, EventArgs e) { Properties.Settings.Default.KYKLogPath = Delegates.Text.Get(txtKYKLogPath); Properties.Settings.Default.KYKUserName = Delegates.Text.Get(txtUserName); Properties.Settings.Default.KYKPassword = Delegates.Text.Get(txtPass); Properties.Settings.Default.ADSOYAD = Delegates.Text.Get(txtAdSoyad); Optimizasyon.Delagate(trackBar1, () => { Properties.Settings.Default.ZamanAsimi = trackBar1.Value; }); Properties.Settings.Default.Save(); MessageBox.Show("Ayarlar başarıyla kaydedildi!", "Bilgi", MessageBoxButtons.OK, MessageBoxIcon.Information); }
private void SettingsForm_Load(object sender, EventArgs e) { Delegates.Text.Set(txtKYKLogPath, Properties.Settings.Default.KYKLogPath); Delegates.Text.Set(txtUserName, Properties.Settings.Default.KYKUserName); Delegates.Text.Set(txtPass, Properties.Settings.Default.KYKPassword); Delegates.Text.Set(txtAdSoyad, Properties.Settings.Default.ADSOYAD); Optimizasyon.Delagate(trackBar1, () => { trackBar1.Value = Properties.Settings.Default.ZamanAsimi; }); int Value = -1; Optimizasyon.Delagate(trackBar1, () => { Value = trackBar1.Value; }); Delegates.Text.Set(lblZamanAsimi, string.Format("{0} saniye", Value.ToString())); }
private void checkBox1_CheckedChanged(object sender, EventArgs e) { bool check = false; Optimizasyon.Delagate(checkBox1, () => { check = checkBox1.Checked; }); Optimizasyon.Delagate(txtPass, () => { txtPass.UseSystemPasswordChar = !check; }); }
private void CreateDriver() { srv.Start(); Properties.Settings.Default.AcilanServisler.Add(srv.ProcessId.ToString()); Properties.Settings.Default.Save(); ChromeOptions options = new ChromeOptions(); options.AddArgument("disable-infobars"); driver = new ChromeDriver(srv, options); driver.Manage().Timeouts().PageLoad = new TimeSpan(0, 0, ZamanAsimi); driver.Manage().Window.Minimize(); DriverChanged(); Optimizasyon.Delagate(this, () => { this.Focus(); }); }
private void CheckSessionOpen() { SaveKYKLog("Oturum Kontrol Ediliyor..."); status1.SetDurum(Durum.Yukleniyor); if (driver == null) { CreateDriver(); } try { driver.Navigate().GoToUrl("https://wifi.kyk.gov.tr/"); } catch { } Optimizasyon.Delagate(chckKYK, () => { string caption = string.Format("30 sn de bir oturumuzu kontrol eder eğer wifi.kyk.gov.tr \nüzerinde oturum açılması gerekiyorsa otomatik giriş yapar.\nEn son kontrol edilme :{0}", DateTime.Now.ToLongTimeString()); toolTip1.SetToolTip(chckKYK, caption); }); if (IsEnteredSucceed(driver)) { status1.SetDurum(Durum.Aktif); if (girisyapti == false) { girisyapti = true; GirisYapildi(); } } else { status1.SetDurum(Durum.Pasif); girisyapti = false; SaveKYKLog("Oturum Kapalı! Oturum Açılıyor..."); GirisYap(); if (IsEnteredSucceed(driver)) { status1.SetDurum(Durum.Aktif); } } }
private void SetStatusDelegate(Durum durum) { Optimizasyon.Delagate(status1, () => { status1.SetDurum(durum); }); }