Beispiel #1
0
 public void SetProfileType(EnumProfileType profileType)
 {
     if (profileType == EnumProfileType.Default)
     {
         radioButtonFactory.Checked = true;
     }
     else if (profileType == EnumProfileType.Named)
     {
         radioButtonNamed.Checked = true;
     }
     else
     {
         radioButtonUser.Checked = true;
     }
 }
Beispiel #2
0
 private void buttonOK_Click(object sender, EventArgs e)
 {
     Revert = checkBoxRevert.Checked;
     if (Revert)
     {
         if (MessageBox.Show(this, "Reverting to the factory settings will erase all modifications to the application configuration stored in the selected profile. Do you want to continue?", "Select configurations", MessageBoxButtons.YesNo, MessageBoxIcon.Question) != DialogResult.Yes)
         {
             Revert = false;
             return;
         }
     }
     if (radioButtonFactory.Checked)
     {
         ProfileType       = EnumProfileType.Default;
         this.DialogResult = DialogResult.OK;
     }
     else
     {
         if (radioButtonUser.Checked)
         {
             ProfileType       = EnumProfileType.User;
             this.DialogResult = DialogResult.OK;
         }
         else
         {
             if (string.IsNullOrEmpty(comboBoxNames.Text))
             {
                 MessageBox.Show(this, "Profile name cannot be empty", this.Text, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
             }
             else
             {
                 ProfileType       = EnumProfileType.Named;
                 ProfileName       = comboBoxNames.Text;
                 ProfilePass       = textBoxPass1.Text;
                 this.DialogResult = DialogResult.OK;
             }
         }
     }
 }
Beispiel #3
0
 public ConfigProfile(string name, string file, EnumProfileType type)
 {
     ProfileName = name;
     ProfilePath = file;
     ProfileType = type;
 }