Пример #1
0
 public IISUrlRewriteRule(string name,
                          UrlMatch initialMatch,
                          ConditionCollection conditions,
                          UrlAction action)
     : this(name, initialMatch, conditions, action, false)
 {
 }
Пример #2
0
        private void textBox_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (inputTweetBox.Text.Length == 0)
            {
                labelCount.Text          = "(0/280)";
                labelCount2.Text         = "(0/280)";
                inputTweetBox.Background = new SolidColorBrush(Color.FromRgb(255, 255, 255));
            }
            else
            {
                MatchCollection mt = UrlMatch.Matches(inputTweetBox.Text);
                tweetLength = 0;
                for (int i = 0; i < mt.Count; i++)
                {
                    tweetLength += mt[i].Length;
                }
                int enterCount = inputTweetBox.Text.Count(x => x == '\n');                //줄바꿈문자는 \r\n인데 2글자라 entercount를 빼서 셈
                int charLength = GetCharLength(inputTweetBox.Text);
                tweetLength = charLength - tweetLength + 23 * mt.Count - enterCount;
                if (tweetLength > 280)
                {
                    inputTweetBox.Background = new SolidColorBrush(Color.FromRgb(0xff, 0xa7, 0xa7));
                }
                else
                {
                    inputTweetBox.Background = new SolidColorBrush(Color.FromRgb(255, 255, 255));
                }

                labelCount.Text  = $"({tweetLength}/280)";
                labelCount2.Text = $"({tweetLength}/280)";
            }
        }
        public void AddUrlMatch(string input, bool ignoreCase = true, bool negate = false, PatternSyntax patternSyntax = PatternSyntax.ECMAScript)
        {
            switch (patternSyntax)
            {
            case PatternSyntax.ECMAScript:
            {
                if (ignoreCase)
                {
                    var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout);
                    _initialMatch = new RegexMatch(regex, negate);
                }
                else
                {
                    var regex = new Regex(input, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout);
                    _initialMatch = new RegexMatch(regex, negate);
                }
                break;
            }

            case PatternSyntax.Wildcard:
                throw new NotSupportedException("Wildcard syntax is not supported");

            case PatternSyntax.ExactMatch:
                _initialMatch = new ExactMatch(ignoreCase, input, negate);
                break;
            }
        }
Пример #4
0
 public IISUrlRewriteRule(string name,
                          UrlMatch initialMatch,
                          ConditionCollection conditions,
                          UrlAction action,
                          bool global)
 {
     Name         = name;
     InitialMatch = initialMatch;
     Conditions   = conditions;
     Action       = action;
     Global       = global;
 }
Пример #5
0
 public void AddMatch(
     ParsedModRewriteInput input,
     Flags flags)
 {
     if (flags.HasFlag(FlagType.NoCase))
     {
         _match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.IgnoreCase, _regexTimeout), input.Invert);
     }
     else
     {
         _match = new RegexMatch(new Regex(input.Operand, RegexOptions.CultureInvariant | RegexOptions.Compiled, _regexTimeout), input.Invert);
     }
 }
Пример #6
0
 public Condition(Pattern input, UrlMatch match, bool orNext)
 {
     Input  = input;
     Match  = match;
     OrNext = orNext;
 }
Пример #7
0
 public ApacheModRewriteRule(UrlMatch initialMatch, IList <Condition> conditions, IList <UrlAction> urlActions)
 {
     Conditions   = conditions;
     InitialMatch = initialMatch;
     Actions      = urlActions;
 }
Пример #8
0
 public Condition(Pattern input, UrlMatch match)
 {
     Input = input;
     Match = match;
 }