コード例 #1
0
        public string Match(ControlString controlString)
        {
            if (!Matches(controlString))
            {
                throw new ArgumentException("Argument cannot be matched by this matcher.", nameof(controlString));
            }

            return(Matcher(controlString));
        }
コード例 #2
0
        public bool Matches(ControlString controlString)
        {
            if (controlString is null)
            {
                throw new ArgumentNullException(nameof(controlString));
            }

            return(ControlStringMatchers.Any(x => x.Matches(controlString)));
        }
コード例 #3
0
        public string Match(ControlString controlString)
        {
            if (!Matches(controlString))
            {
                throw new ArgumentException("Argument cannot be matched by this matcher.", "controlString");
            }

            return ControlStringMatchers.First(x => x.Matches(controlString)).Match(controlString);
        }
コード例 #4
0
 public bool Matches(ControlString controlString)
 {
     try
     {
         return controlString.Values.Peek().Equals(Context) && Matcher.Matches(controlString.NextControlString);
     }
     catch (Exception e)
     {
         throw new ControlStringParseException("Error processing controlString " + string.Join(":", controlString.Values.ToArray()) + ".\n\r" + e.Message, e);
     }
 }
コード例 #5
0
        public string Match(ControlString controlString)
        {
            if (controlString is null)
            {
                throw new ArgumentNullException(nameof(controlString));
            }

            if (!Matches(controlString))
            {
                throw new ArgumentException("Argument cannot be matched by this matcher.", nameof(controlString));
            }

            return(ControlStringMatchers.First(x => x.Matches(controlString)).Match(controlString));
        }
コード例 #6
0
        public bool Matches(ControlString controlString)
        {
            if (controlString is null)
            {
                throw new ArgumentNullException(nameof(controlString));
            }

            try
            {
                return(controlString.Values.Peek().Equals(Context) && Matcher.Matches(controlString.NextControlString));
            }
            catch (Exception e)
            {
                throw new ControlStringParseException("Error processing controlString " + string.Join(":", controlString.Values.ToArray()) + ".\n\r" + e.Message, e);
            }
        }
コード例 #7
0
 public bool Matches(ControlString controlString) => CanMatch(controlString);
コード例 #8
0
 public bool Matches(ControlString controlString)
 {
     return ControlStringMatchers.Any(x => x.Matches(controlString));
 }
コード例 #9
0
 public bool Matches(ControlString controlString) => source().All(x => x.Matches(controlString));
コード例 #10
0
 public string Match(ControlString controlString) => beginningText + string.Join(separator, source().Select(x => x.Match(controlString)).ToArray()) + terminatingText;
コード例 #11
0
 public bool Matches(ControlString controlString)
 {
     return CanMatch(controlString);
 }