public List <IFarsightDashModule> CreateModules(IFarsightModuleRegistry moduleRegistry)
        {
            RegexReturnTypeEnum returnType = RegexReturnTypeEnum.FirstMatch;

            if (ReturnFirstMatch.IsChecked == true)
            {
                returnType = RegexReturnTypeEnum.FirstMatch;
            }
            if (ReturnLastMatch.IsChecked == true)
            {
                returnType = RegexReturnTypeEnum.LastMatch;
            }
            if (ReturnAllMatches.IsChecked == true)
            {
                returnType = RegexReturnTypeEnum.AllMatches;
            }

            string separator = Environment.NewLine;

            if (SeparateWithText.IsChecked == true)
            {
                separator = SeparatorText.Text;
            }

            var filter = new RegexFilter(RegexFilterTextBox.Text, returnType, separator);

            return(new List <IFarsightDashModule>()
            {
                filter
            });
        }
Example #2
0
 public RegexFilter(string regexString, RegexReturnTypeEnum returnType, string separator)
 {
     _RegexString     = regexString;
     _ReturnType      = returnType;
     _SeparatorString = separator;
 }