/// <summary> /// Displays the dialog. /// </summary> public CertificateIdentifier ShowDialog(CertificateStoreIdentifier store, bool allowStoreChange) { CertificateStoreCTRL.StoreType = CertificateStoreType.Directory; CertificateStoreCTRL.StorePath = String.Empty; CertificateStoreCTRL.ReadOnly = !allowStoreChange; CertificatesCTRL.Initialize(null); OkBTN.Enabled = false; if (store != null) { CertificateStoreCTRL.StoreType = store.StoreType; CertificateStoreCTRL.StorePath = store.StorePath; } if (ShowDialog() != DialogResult.OK) { return(null); } CertificateIdentifier id = new CertificateIdentifier(); id.StoreType = CertificateStoreCTRL.StoreType; id.StorePath = CertificateStoreCTRL.StorePath; id.Certificate = CertificatesCTRL.SelectedCertificate; return(id); }
private void CertificateStoreCTRL_StoreChanged(object sender, EventArgs e) { try { CertificateStoreIdentifier store = new CertificateStoreIdentifier(); store.StoreType = CertificateStoreCTRL.StoreType; store.StorePath = CertificateStoreCTRL.StorePath; CertificatesCTRL.Initialize(store, null); FilterBTN_Click(sender, e); } catch (Exception exception) { GuiUtils.HandleException(this.Text, MethodBase.GetCurrentMethod(), exception); } }