private void EnableAvailableCertificateOption() { if (this.checkBoxUserCert.Checked == true) { if (this.comboBoxCertType.SelectedIndex == 0) // Use Profile of Tizen Certificate Manager { this.selectedCertType = Certificate.CertificateType.Profile; this.comboBoxCertType.Enabled = true; this.groupBoxProfile.Enabled = true; this.groupBoxCertificate.Enabled = false; } else if (this.comboBoxCertType.SelectedIndex == 1) // Direct Register { this.selectedCertType = Certificate.CertificateType.Manual; this.comboBoxCertType.Enabled = true; this.groupBoxProfile.Enabled = false; this.groupBoxCertificate.Enabled = true; } } else { this.selectedCertType = Certificate.CertificateType.Default; // Disable All Option Group this.comboBoxCertType.Enabled = false; this.groupBoxProfile.Enabled = false; this.groupBoxCertificate.Enabled = false; } if (this.checkBoxShowAuthorpw.Checked == true) { this.textAuthorPass.UseSystemPasswordChar = false; } else { this.textAuthorPass.UseSystemPasswordChar = true; } if (this.checkBoxShowDistpw.Checked == true) { this.textDistributorPass.UseSystemPasswordChar = false; } else { this.textDistributorPass.UseSystemPasswordChar = true; } }
public void UpdateData(bool save) { if (comboBoxProfile.InvokeRequired) { DgtUpdateData scpc = new DgtUpdateData(UpdateData); this.Invoke(scpc, new object[] { save }); } else { if (save) { this.page.OptionAuthorCertiFile = textAuthorPath.Text; this.page.OptionAuthorCertiPass = textAuthorPass.Text.EncryptAes(); this.page.OptionDistributorCertiFile = textDistributorPath.Text; this.page.OptionDistributorCertiPass = textDistributorPass.Text.EncryptAes(); this.page.OptionSelectedCertificateType = selectedCertType; } else // Load Data from certificate Dialog Page { textAuthorPath.Text = this.page.OptionAuthorCertiFile; textAuthorPass.Text = this.page.OptionAuthorCertiPass.DecryptAes(); textDistributorPath.Text = this.page.OptionDistributorCertiFile; textDistributorPass.Text = this.page.OptionDistributorCertiPass.DecryptAes(); textProfilePath.Text = ToolsPathInfo.DefaultCertPath; if (this.page.optionProfileList != null && this.page.optionProfileList.Count > 0 && !string.IsNullOrEmpty(this.page.optionProfileSelected)) { int index = this.page.optionProfileList.IndexOf(this.page.optionProfileSelected); if (index != -1) { this.page.optionProfileList[index] = this.page.optionProfileSelected + " <Active>"; } comboBoxProfile.Items.Clear(); comboBoxProfile.Items.AddRange(this.page.optionProfileList.ToArray()); comboBoxProfile.SelectedItem = this.page.optionProfileSelected + " <Active>"; } else { comboBoxProfile.Items.Clear(); comboBoxProfile.Items.Insert(0, STR_noprofile); comboBoxProfile.SelectedIndex = 0; } selectedCertType = this.page.OptionSelectedCertificateType; if (selectedCertType == Certificate.CertificateType.Default) { this.checkBoxUserCert.Checked = false; } else if (selectedCertType == Certificate.CertificateType.Profile) { this.checkBoxUserCert.Checked = true; this.comboBoxCertType.SelectedIndex = 0; } else if (selectedCertType == Certificate.CertificateType.Manual) { this.checkBoxUserCert.Checked = true; this.comboBoxCertType.SelectedIndex = 1; } else { selectedCertType = Certificate.CertificateType.Default; this.checkBoxUserCert.Checked = false; } EnableAvailableCertificateOption(); OptionValidate(); } } }