Exemple #1
0
        private void deletePreConButton_Click(object sender, EventArgs e)
        {
            PreConfigCtrlForm ctrlForm = new PreConfigCtrlForm();

            ctrlForm.Name      = preConNameComboBox.SelectedItem.ToString();
            ctrlForm.ReadOnly  = true;
            ctrlForm.Operation = "Delete";

            if (ctrlForm.ShowDialog() == DialogResult.OK)
            {
                Config.Local.DeleteDelimitingRule(ctrlForm.Name);

                // remove rule from combo-box
                preConNameComboBox.Items.Remove(preConNameComboBox.SelectedItem);
                if (preConNameComboBox.Items.Count > 0)
                {
                    preConNameComboBox.SelectedIndex = 0;
                }
                else
                {
                    preConNameComboBox.SelectedIndex = -1;
                    preConNameComboBox.Text          = "";
                }
            }
            preConNameComboBox_UpdateList(null);
        }
Exemple #2
0
        private void newPreConButton_Click(object sender, EventArgs e)
        {
            PreConfigCtrlForm ctrlForm = new PreConfigCtrlForm();

            ctrlForm.Name      = "";
            ctrlForm.ReadOnly  = false;
            ctrlForm.Operation = "Create";

            if (ctrlForm.ShowDialog() == DialogResult.OK && !string.IsNullOrEmpty(ctrlForm.Value))
            {
                Config.Local.CreateDelimitingRule(ctrlForm.Value, CsvDelimiters);
            }

            preConNameComboBox_UpdateList(ctrlForm.Value);
        }