public ConditionVisitor(ParameterExpression message, ErrorListener errors, Route route, RouteCompilerFlags routeCompilerFlags) { this.message = Preconditions.CheckNotNull(message); this.errors = Preconditions.CheckNotNull(errors); this.route = Preconditions.CheckNotNull(route); this.routeCompilerFlags = routeCompilerFlags; }
public Func <IMessage, Bool> Compile(Route route, RouteCompilerFlags routeCompilerFlags) { var errorListener = new ErrorListener(); IParseTree tree = GetParseTree(route, errorListener); errorListener.Validate(); ParameterExpression parameter = Expression.Parameter(typeof(IMessage), "message"); var visitor = new ConditionVisitor(parameter, errorListener, route, routeCompilerFlags); Expression expression = visitor.Visit(tree); errorListener.Validate(); Func <IMessage, Bool> rule = Expression.Lambda <Func <IMessage, Bool> >(Expression.Convert(expression, typeof(Bool)), parameter).Compile(); return(rule); }
public override bool IsEnabled(RouteCompilerFlags routeCompilerFlags) { return(routeCompilerFlags.HasFlag(RouteCompilerFlags.BodyQuery)); }
public virtual bool IsEnabled(RouteCompilerFlags routeCompilerFlags) { return(true); }
public override bool IsEnabled(RouteCompilerFlags routeCompilerFlags) { return(routeCompilerFlags.HasFlag(RouteCompilerFlags.TwinChangeIncludes)); }
public static bool IsFlagEnabled(this RouteCompilerFlags routeCompilerFlags, RouteCompilerFlags flagToCheck) { return((routeCompilerFlags & flagToCheck) != 0); }