Exemplo n.º 1
0
        private void addConfigurationButton_Click(object sender, EventArgs e)
        {
            var addConfig = new AddConfiguration();

            var result = addConfig.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                Program.configManager.AddConfiguration(addConfig.configNameTextBox.Text);

                activeConfigurationComboBox.SelectedIndex = activeConfigurationComboBox.Items.Count - 2;
            }
        }
Exemplo n.º 2
0
        private void OnRequireNewConfig()
        {
            var addConfig = new AddConfiguration();

            var result = addConfig.ShowDialog();

            if (result == System.Windows.Forms.DialogResult.OK)
            {
                Program.configManager.AddConfiguration(addConfig.configNameTextBox.Text);

                activeConfigurationComboBox.SelectedIndex = activeConfigurationComboBox.Items.Count - 2;
            }
            else if (result == System.Windows.Forms.DialogResult.Cancel)
            {
                Application.Exit();
            }
        }
Exemplo n.º 3
0
        private void activeConfigurationComboBox_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (activeConfigurationComboBox.SelectedIndex == activeConfigurationComboBox.Items.Count - 1)
            {
                var addConfig = new AddConfiguration();

                var result = addConfig.ShowDialog();

                if (result == System.Windows.Forms.DialogResult.OK)
                {
                    Program.configManager.AddConfiguration(addConfig.configNameTextBox.Text);

                    activeConfigurationComboBox.SelectedIndex = activeConfigurationComboBox.Items.Count - 2;
                }
                else if (result == System.Windows.Forms.DialogResult.Cancel)
                {
                    activeConfigurationComboBox.SelectedIndex = lastSelectedConfigurationIndex;
                }
            }
            else
            {
                Program.configManager.SetActiveConfiguration(activeConfigurationComboBox.SelectedItem.ToString());

                SyncAll();

                lastSelectedConfigurationIndex = activeConfigurationComboBox.SelectedIndex;
            }
        }