Example #1
0
        internal LexPattern SetStringComparison(StringCaseComparison stringComparison)
        {
            if (this.stringComparison.HasValue)
            {
                throw new ArgumentException();
            }

            this.stringComparison = stringComparison;

            if (Type == TypeEnum.Regex)
            {
                try
                {
                    Rule.FormatAsRegex(pattern.AsInternalRegex(), stringComparison);
                }
                catch (ArgumentException ex)
                {
                    throw ParseControlException.NewAndRun(ex.Message);
                }
            }

            return(this);
        }