Example #1
0
        /// <summary>
        /// Update state after a new page is shown.
        /// </summary>
        private void OnWizardPageChanged(object sender, EventArgs e)
        {
            this.UpdateState();

            if (4 == this.wizard.SelectedIndex)
            {
                this.cancelButton.Text = "Finished";
            }
            else
            {
                this.cancelButton.Text = "Cancel";
            }

            switch (this.wizard.SelectedIndex)
            {
            case 1:
                this.settingsControl.FocusFirst();
                break;

            case 2:
                this.passwordControl.FocusFirst();
                break;

            case 3:
                if (this.nextButton == this.lastPressedButton)
                {
                    var folder = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
                    var name   = CertificateWizard.StripInvalidPathCharacters(this.settingsControl.UserName);
                    if (name.Length == 0)
                    {
                        name = "Certificate";
                    }
                    this.saveAsControl.FileName = System.IO.Path.Combine(folder, name + ".pfx");
                }
                this.saveAsControl.FocusFirst();
                break;

            case 4:
                this.CreateCertificate();
                break;
            }
        }
 /// <summary>
 /// Create a new certificate.
 /// </summary>
 private void OnCreateCertificateClick(object sender, EventArgs e)
 {
     using (var dialog = new CertificateWizard())
     {
         if (dialog.ShowDialog(this) != DialogResult.OK)
             return;
         OpenCertificate(dialog.Path, dialog.Password);
     }
 }
Example #3
0
 /// <summary>
 /// Create new certificate
 /// </summary>
 private void OnCreateClick(object sender, EventArgs e)
 {
     using (var dialog = new CertificateWizard())
     {
         dialog.ShowDialog(this);
     }
 }