/// <summary> /// When overridden in a derived class, specifies a common dialog box. /// </summary> /// <param name="hwndOwner">A value that represents the window handle of the owner window for the common dialog box.</param> /// <returns> /// true if the dialog box was successfully run; otherwise, false. /// </returns> protected override bool RunDialog(IntPtr hwndOwner) { using (X509CertificatePickerView view = new X509CertificatePickerView(this.storeLocation, this.storeName)) { DialogResult result = view.ShowDialog(this.owner); if (result == DialogResult.OK) { this.storeName = view.StoreName; this.storeLocation = view.StoreLocation; this.Certificate = new X509Certificate2(view.Certificate.RawData); } return(result == DialogResult.OK); } }
/// <summary> /// When overridden in a derived class, specifies a common dialog box. /// </summary> /// <param name="hwndOwner">A value that represents the window handle of the owner window for the common dialog box.</param> /// <returns> /// true if the dialog box was successfully run; otherwise, false. /// </returns> protected override bool RunDialog(IntPtr hwndOwner) { using (X509CertificatePickerView view = new X509CertificatePickerView(this.storeLocation, this.storeName)) { DialogResult result = view.ShowDialog(this.owner); if (result == DialogResult.OK) { this.storeName = view.StoreName; this.storeLocation = view.StoreLocation; this.Certificate = new X509Certificate2(view.Certificate.RawData); } return result == DialogResult.OK; } }