override protected List <PossibleMatch> ImplementMatch(PossibleMatch State, MatchContext Context) { var R = new List <PossibleMatch>(); if (String.IsNullOrEmpty(BooleanProperty)) { R.AddRange(Sub.Match(State, Context)); if (R.Count == 0) { R.Add(State); } } else { R.AddRange(Sub.Match(State, Context).Select(s => s.With(BooleanProperty, true))); if (R.Count == 0) { R.Add(State.With(BooleanProperty, false)); } } return(R); }
protected override List<PossibleMatch> ImplementMatch(PossibleMatch State, MatchContext Context) { return new List<PossibleMatch>() { State.With(Name, Value) }; }