Beispiel #1
0
        private void btnReIssueProfile_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Reissuing a profile certificate will allow you register again with the same email address and change your information in the profile certificate while keeping all your profile settings intact.\r\n\r\nAre you sure you want to reissue the selected profile?\r\n\r\nWARNING! This will revoke the previously issued profile certificate however, your settings will remain intact.", "Reissue Profile Certificate?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
            {
                this.Hide();

                _profileFilePath = Path.Combine(_localAppData, (lstProfiles.SelectedItem as string) + ".profile");

                using (frmPassword frm = new frmPassword(_profileFilePath))
                {
                    if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                    {
                        _profile = frm.Profile;

                        using (frmRegister frmReg = new frmRegister(_localAppData, _profile, _profileFilePath, true))
                        {
                            if (frmReg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                            {
                                _profile         = frmReg.Profile;
                                _profileFilePath = frmReg.ProfileFilePath;

                                string profileName = Path.GetFileNameWithoutExtension(_profileFilePath);
                                lstProfiles.SelectedItem = profileName;
                            }
                        }
                    }
                }

                this.Show();
            }
        }
Beispiel #2
0
        private void btnStart_Click(object sender, EventArgs e)
        {
            _profileFilePath = Path.Combine(_localAppData, (lstProfiles.SelectedItem as string) + ".profile");

            using (frmPassword frm = new frmPassword(_profileFilePath))
            {
                if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    _profile = frm.Profile;

                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
        }
        private void frmProfileManager_Load(object sender, EventArgs e)
        {
            if (_loaded)
                return;

            switch (lstProfiles.Items.Count)
            {
                case 0:
                    using (frmWelcome frm = new frmWelcome(_localAppData))
                    {
                        DialogResult result = frm.ShowDialog(this);

                        switch (result)
                        {
                            case System.Windows.Forms.DialogResult.OK:
                                _profile = frm.Profile;
                                _profileFilePath = frm.ProfileFilePath;

                                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                                this.Close();
                                break;

                            case System.Windows.Forms.DialogResult.Ignore:
                                btnImportProfile_Click(null, null);
                                break;

                            default:
                                this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                                this.Close();
                                break;
                        }
                    }
                    break;

                case 1:
                    _profileFilePath = Path.Combine(_localAppData, (lstProfiles.Items[0] as string) + ".profile");

                    using (frmPassword frm = new frmPassword(_profileFilePath))
                    {
                        switch (frm.ShowDialog(this))
                        {
                            case System.Windows.Forms.DialogResult.OK:
                                _profile = frm.Profile;

                                this.DialogResult = System.Windows.Forms.DialogResult.OK;
                                this.Close();
                                break;

                            case System.Windows.Forms.DialogResult.Yes:
                                btnNewProfile_Click(null, null);
                                break;
                        }
                    }
                    break;

                default:
                    break;
            }
        }
        private void btnStart_Click(object sender, EventArgs e)
        {
            _profileFilePath = Path.Combine(_localAppData, (lstProfiles.SelectedItem as string) + ".profile");

            using (frmPassword frm = new frmPassword(_profileFilePath))
            {
                if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                {
                    _profile = frm.Profile;

                    this.DialogResult = System.Windows.Forms.DialogResult.OK;
                    this.Close();
                }
            }
        }
        private void btnReIssueProfile_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Reissuing a profile certificate will allow you register again with the same email address and change your information in the profile certificate while keeping all your profile settings intact.\r\n\r\nAre you sure you want to reissue the selected profile?\r\n\r\nWARNING! This will revoke the previously issued profile certificate however, your settings will remain intact.", "Reissue Profile Certificate?", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == System.Windows.Forms.DialogResult.Yes)
            {
                this.Hide();

                _profileFilePath = Path.Combine(_localAppData, (lstProfiles.SelectedItem as string) + ".profile");

                using (frmPassword frm = new frmPassword(_profileFilePath))
                {
                    if (frm.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                    {
                        _profile = frm.Profile;

                        using (frmRegister frmReg = new frmRegister(_localAppData, _profile, _profileFilePath, true))
                        {
                            if (frmReg.ShowDialog(this) == System.Windows.Forms.DialogResult.OK)
                            {
                                _profile = frmReg.Profile;
                                _profileFilePath = frmReg.ProfileFilePath;

                                string profileName = Path.GetFileNameWithoutExtension(_profileFilePath);
                                lstProfiles.SelectedItem = profileName;
                            }
                        }
                    }
                }

                this.Show();
            }
        }
Beispiel #6
0
        private void frmProfileManager_Load(object sender, EventArgs e)
        {
            if (_loaded)
            {
                return;
            }

            switch (lstProfiles.Items.Count)
            {
            case 0:
                using (frmWelcome frm = new frmWelcome(_localAppData))
                {
                    DialogResult result = frm.ShowDialog(this);

                    switch (result)
                    {
                    case System.Windows.Forms.DialogResult.OK:
                        _profile         = frm.Profile;
                        _profileFilePath = frm.ProfileFilePath;

                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
                        this.Close();
                        break;

                    case System.Windows.Forms.DialogResult.Ignore:
                        btnImportProfile_Click(null, null);
                        break;

                    default:
                        this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
                        this.Close();
                        break;
                    }
                }
                break;

            case 1:
                _profileFilePath = Path.Combine(_localAppData, (lstProfiles.Items[0] as string) + ".profile");

                using (frmPassword frm = new frmPassword(_profileFilePath))
                {
                    switch (frm.ShowDialog(this))
                    {
                    case System.Windows.Forms.DialogResult.OK:
                        _profile = frm.Profile;

                        this.DialogResult = System.Windows.Forms.DialogResult.OK;
                        this.Close();
                        break;

                    case System.Windows.Forms.DialogResult.Yes:
                        btnNewProfile_Click(null, null);
                        break;
                    }
                }
                break;

            default:
                break;
            }
        }