public FormMain() { InitializeComponent(); bot = new Neobux(string.Empty, string.Empty, string.Empty); bot.OnProgress += bot_OnProgress; bot.OnFinish += bot_OnFinish; txtUsername.Text = ConfigurationManager.AppSettings["username"]; txtPassword.Text = ConfigurationManager.AppSettings["password"]; txtExtraPassword.Text = ConfigurationManager.AppSettings["extrapassword"]; frequency.Value = decimal.Parse(ConfigurationManager.AppSettings["frequency"]); }
private void FormMain_FormClosed(object sender, FormClosedEventArgs e) { UpdateSettings(); if (timer1 != null) { timer1.Enabled = false; timer1.Dispose(); } if (bot != null) { bot.OnFinish -= bot_OnFinish; bot.OnProgress -= bot_OnProgress; bot.Dispose(); bot = null; } }