Exemplo n.º 1
0
        private void SaveButton_Click(object sender, EventArgs e)
        {
            if (ProfilePanelLabel.Text == "Profile Setup")
            {
                // put new setting name --> add new profile
                _getDatafomTextBox1();
                GetEnteredDataAsNewProfile();  ////  change
                Data.profileNames.Clear();
                cascadelist();
                Form1 frm1 = new Form1();
                frm1.Activate();
                frm1.Refresh();
                frm1.ProfileNameBox.Items.Clear();
                Dispose();
            }
            if (Data._mode == "Edit")
            {
                CascadeDelete._cascadeDelete();
                _getDatafomTextBox1();
                GetEnteredDataAsNewProfile();
                // get setting name --> delete --> add with the same name

                Dispose();
            }
            if (Data._mode == "Delete")
            {
                CascadeDelete._cascadeDelete();
            }
        }
Exemplo n.º 2
0
 private void deleteProfileToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (string.IsNullOrEmpty(Data.SettingName))
     {
         MessageBox.Show("Please first select a profile to Delete");
         return;
     }
     else
     {
         DialogResult dr = MessageBox.Show("Do you really want to delete profile?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
         if (dr == DialogResult.Yes)
         {
             CascadeDelete._cascadeDelete();
             Data.profileNames.Clear();
             ProfileNameBox.Items.Clear();
             cascadelist();
             ProfileNameBox.ResetText();
             UserNameBox.Text   = "";
             ServerNameBox.Text = "";
         }
         else
         {
             return;
         }
     }
 }