Пример #1
0
 private void CopyPresetButton_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK == presetName.ShowDialog(""))
     {
         Preset preset = current_preset.Clone();
         preset.name = presetName.textBox1.Text.Trim();
         presets.Add(preset);
         PresetComboBox.Items.Add(preset.name);
         PresetComboBox.SelectedItem = preset.name;
         Saver.save_add_preset(preset.name);
         foreach (var item in preset.buttons)
         {
             Saver.save_button_settings(preset.name, item, true);
         }
     }
 }
Пример #2
0
 private void AddPresetButton_Click(object sender, EventArgs e)
 {
     if (DialogResult.OK == presetName.ShowDialog(""))
     {
         Preset preset = new Preset();
         preset.name              = presetName.textBox1.Text.Trim();
         preset.buttons           = new List <CustomButton>();
         preset.default_backcolor = Color.White;
         preset.default_textcolor = Color.Black;
         preset.default_font      = new Font("Consolas", 14.25F, FontStyle.Regular);
         presets.Add(preset);
         PresetComboBox.Items.Add(preset.name);
         PresetComboBox.SelectedItem = preset.name;
         Saver.save_add_preset(preset.name);
     }
 }