Exemple #1
0
        protected override void InternalLoadContent(FilterEntry.FilterItemText filterItem)
        {
            this.textEdit.TextChanged -= this.textEdit_TextChanged;

            this.textEdit.Lines = filterItem.TextLines.ToArray();
            this.textFromCurrentItemButton.Enabled = !String.IsNullOrEmpty(this.CurrentItemValue);

            this.textEdit.TextChanged += new System.EventHandler(this.textEdit_TextChanged);

            switch (filterItem.EditorToShow)
            {
            case FilterEntry.FilterItemText.EditorSelection.FreeMode:
                this.tabControl.SelectedTab = freeDefinitionTabPage;
                break;

            case FilterEntry.FilterItemText.EditorSelection.DistinctValues:
                this.tabControl.SelectedTab = distinctValuesTabPage;
                break;

            default:
                throw new InvalidOperationException("Unsupported value: " + filterItem.EditorToShow);
            }
            if (filterItem.UseRegex)
            {
                this.tabControl.SelectedTab = freeDefinitionTabPage;
            }
            useRegexCheckBox.Checked = filterItem.UseRegex;
        }
Exemple #2
0
        public override void SaveContent(FilterEntry.FilterItemText filterItem)
        {
            filterItem.EditorToShow = this.tabControl.SelectedTab == freeDefinitionTabPage ? FilterEntry.FilterItemText.EditorSelection.FreeMode : FilterEntry.FilterItemText.EditorSelection.DistinctValues;
            filterItem.UseRegex     = useRegexCheckBox.Checked;

            base.SaveContent(filterItem);
            filterItem.SaveTextLines(this.textEdit.Lines.Where(s => !s.Equals(String.Empty)));
        }