示例#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)));
        }
        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);
        }
 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));
        }
        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);
 public bool Matches(ControlString controlString)
 {
     return ControlStringMatchers.Any(x => x.Matches(controlString));
 }
 public bool Matches(ControlString controlString) => source().All(x => x.Matches(controlString));
 public string Match(ControlString controlString) => beginningText + string.Join(separator, source().Select(x => x.Match(controlString)).ToArray()) + terminatingText;
 public bool Matches(ControlString controlString)
 {
     return CanMatch(controlString);
 }