private void buttonLoadCertificate_Click(object sender, EventArgs e) { FormChooseAuthCertificate oForm = new FormChooseAuthCertificate(); DialogResult result = oForm.ShowDialog(this); if (result == DialogResult.Cancel) { return; } textBoxAuthCertificate.Tag = oForm.Certificate; textBoxAuthCertificate.Text = oForm.Certificate.Subject; }
public FormMain() { InitializeComponent(); _formConfig = new ClassFormConfig(this); this.Text = Application.ProductName + " v" + Application.ProductVersion; _oAuthHelper = new ClassOAuthHelper(); if (!String.IsNullOrEmpty(textBoxAuthCertificate.Text)) { // We have a certificate specified, but we need to retrieve it to be able to use it textBoxAuthCertificate.Tag = FormChooseAuthCertificate.GetCertificateBySubject(textBoxAuthCertificate.Text); if (textBoxAuthCertificate.Tag == null) { textBoxAuthCertificate.Text = String.Empty; } } UpdateAuthUI(); UpdateEWSUI(); textBoxTenantId_TextChanged(null, null); }