private void AddNewCustomExtractor(CustomMessageExtractor extractor)
 {
     this.config.CustomExtractors.Add(extractor);
     this.RefreshCustomExtractors();
     this.customExtractorsListBox.SelectedItem = extractor;
     this.extractorNameEdit.Focus();
 }
        private void removeButton_Click(object sender, EventArgs e)
        {
            CustomMessageExtractor extractor = this.GetSelectedItem();

            if (extractor == null)
            {
                return;
            }

            if (MessageBox.Show(String.Format("Do you want to remove custom extractor: '{0}'?", extractor), "Remove custom extractor", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
            {
                this.config.CustomExtractors.Remove(extractor);
                this.RefreshCustomExtractors();
            }
        }
        private void moveUpButton_Click(object sender, EventArgs e)
        {
            CustomMessageExtractor extractor = this.GetSelectedItem();

            if (extractor == null)
            {
                return;
            }

            int index = this.config.CustomExtractors.IndexOf(extractor);

            if (index == 0)
            {
                return;
            }
            this.config.CustomExtractors.RemoveAt(index);

            this.config.CustomExtractors.Insert(index - 1, extractor);

            this.RefreshCustomExtractors();
            this.customExtractorsListBox.SelectedItem = extractor;
        }
        private void LoadSelectedItem()
        {
            CustomMessageExtractor item = this.GetSelectedItem();

            if (item != null)
            {
                this.extractorNameEdit.Text  = item.ExtractorName;
                this.extractorRegexEdit.Text = item.RegexToExtract;
                this.extractorDefaultActionCombo.SelectedValue = item.DefaultAction;
                this.extractorFileExtensionEdit.Text           = item.FileExtension;

                this.editSelectedExtractorPanel.Enabled = true;
            }
            else
            {
                this.extractorNameEdit.Text  = "";
                this.extractorRegexEdit.Text = "";
                this.extractorDefaultActionCombo.SelectedValue = MessageContentExtractorAction.Default;
                this.extractorFileExtensionEdit.Text           = "";

                this.editSelectedExtractorPanel.Enabled = false;
            }
        }
 private void addNewButton_Click(object sender, EventArgs e)
 {
     this.AddNewCustomExtractor(CustomMessageExtractor.CreateDefaultInstance());
 }