private void button1_Click(object sender, EventArgs e) { label4.Text = ""; if(string.IsNullOrWhiteSpace(textBox1.Text) && !checkBox1.Checked) { label4.Text = "You Must enter a Login. "; } if(string.IsNullOrWhiteSpace(textBox2.Text) && !checkBox1.Checked) { label4.Text += "You Must enter a Password. "; } if(string.IsNullOrWhiteSpace(label4.Text)) { var a = new ProxyAuth(textBox1.Text, textBox2.Text, checkBox1.Checked); if(a.Authenticated) { if(OnLoginSuccessEvent != null) OnLoginSuccessEvent(a); } else label4.Text = "Failed to authenticate, try again."; } }
private void StopService() { if (_Hub != null) _Hub.Dispose(); _ProxyAuth = null; }
void _Login_OnLoginSuccessEvent(ProxyAuth auth) { tabPage2.Controls.Clear(); tabPage2.Controls.Add(_ProxyClients); _ProxyClients.ProxyAuth = auth; }