private void tbUsername_TextChanged(object sender, EventArgs e) { credentials.Username = tbUsername.Text; CredentialsDialog credDlg = (CredentialsDialog)this.Parent; credDlg.OKBtn.Enabled = false; if (!string.IsNullOrEmpty(credentials.Username)) { credDlg.OKBtn.Enabled = true; } }
private void rbUseCurrentUserCreds_CheckedChanged(object sender, EventArgs e) { tbUsername.Enabled = false; tbUsername.Text = ""; tbPassword.Enabled = false; tbPassword.Text = ""; credentials.UseDefaultUserCreds = rbUseCurrentUserCreds.Checked; CredentialsDialog credDlg = (CredentialsDialog)this.Parent; credDlg.OKBtn.Enabled = true; }
private void rbUseTheseCreds_CheckedChanged(object sender, EventArgs e) { groupBox.Enabled = rbUseTheseCreds.Checked; tbUsername.Enabled = groupBox.Enabled; tbPassword.Enabled = groupBox.Enabled; CredentialsDialog credDlg = (CredentialsDialog)this.Parent; credDlg.OKBtn.Enabled = false; if (tbUsername.Enabled == true && !string.IsNullOrEmpty(credentials.Username)) { credDlg.OKBtn.Enabled = true; } }
public SelectDomainDialog(string domain, string username) : this() { if (bUseDefaultDomain) { rbDefaultDomain.Checked = true; tbDomain.Text = ""; } else { sUsername = username; tbDomain.Text = domain; rbOtherDomain.Checked = true; } credsDialog = new CredentialsDialog(username); }
private void linkCreds_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { credsDialog = new CredentialsDialog(sUsername); credsDialog.ShowDialog(this); }