private void setup_setParsingOptionOnController(string optionName, bool selected)
        {
            RegexParsingOptions options = controller.GetOptions();

            options.GetByName(optionName).Selected = selected;
            controller.SetOptions(options);
        }
Esempio n. 2
0
        private void setParsingOption(RegexParsingOptions options, RegexOptions flagToSet)
        {
            string           parsingOptionName = Enum.GetName(typeof(RegexOptions), flagToSet);
            ExpressionOption option            = options.GetByName(parsingOptionName);
            bool             shouldBeSelected  = option.Selected;
            bool             isSelected        = getOptionFlag(flagToSet);

            //for readability
            bool shouldNotBeSelected = !shouldBeSelected;
            bool isNotSelected       = !isSelected;


            if (shouldBeSelected && isNotSelected)
            {
                DotNetRegexOptions |= flagToSet;
                return;
            }

            if (shouldNotBeSelected && isSelected)
            {
                DotNetRegexOptions ^= flagToSet;
            }
        }
        private void setParsingOption(RegexParsingOptions options,RegexOptions flagToSet)
        {
            string parsingOptionName = Enum.GetName(typeof(RegexOptions), flagToSet);
            ExpressionOption option = options.GetByName(parsingOptionName);
            bool shouldBeSelected = option.Selected;
            bool isSelected = getOptionFlag(flagToSet);

            //for readability
            bool shouldNotBeSelected = !shouldBeSelected;
            bool isNotSelected = !isSelected;

            if(shouldBeSelected && isNotSelected)
            {
                DotNetRegexOptions |= flagToSet;
                return;
            }

            if(shouldNotBeSelected && isSelected)
            {
                DotNetRegexOptions ^= flagToSet;
            }
        }