static void AddFilter(IMatchOperation matchOperation) { var thisClassType = typeof(ResourcesProvider); var method = thisClassType.GetMethod("AddTypedFilter", BindingFlags.NonPublic | BindingFlags.Static); if (method == null) throw new NullReferenceException("Cannot find method 'AddTypedFilter'"); var typedMethod = method.MakeGenericMethod(matchOperation.filterType); typedMethod.Invoke(null, new object[] { matchOperation }); }
private IMatchOperation [] OpsForPatterns(string [] patterns, MatchType type) { var ops = new IMatchOperation [patterns.Length]; for (int i = 0; i < ops.Length; i++) { ops [i] = MatchOperationFactory.Create(patterns [i], type); } return(ops); }
static void AddTypedFilter <T>(IMatchOperation matchOperation) { var typedMatchOperation = (MatchOperation <T>)matchOperation; s_QueryEngine.AddFilter(typedMatchOperation.matchToken, typedMatchOperation.getFilterData); }
private IMatchOperation[] OpsForPatterns(string [] patterns, MatchType type) { var ops = new IMatchOperation [patterns.Length]; for (int i = 0; i < ops.Length; i++) { ops [i] = MatchOperationFactory.Create (patterns [i], type); } return ops; }
private RouteHandler AddRouteHandler(IManosTarget target, IMatchOperation[] matchOperations, HttpMethod [] methods) { // TODO: Need to decide if this is a good or bad idea // RemoveImplicitHandlers (action); if (target == null) throw new ArgumentNullException ("action"); if (matchOperations == null) throw new ArgumentNullException ("matchOperations"); if (methods == null) throw new ArgumentNullException ("methods"); RouteHandler res = new RouteHandler (matchOperations, methods, target); Routes.Children.Add (res); return res; }
private RouteHandler AddRouteHandler(ManosAction action, IMatchOperation[] matchOperations, HttpMethod [] methods) { return AddRouteHandler (new ActionTarget (action), matchOperations, methods); }
private RouteHandler AddImplicitRouteHandlerForTarget(IManosTarget target, IMatchOperation [] ops, HttpMethod [] methods) { RouteHandler res = new RouteHandler (ops, methods, target) { IsImplicit = true, }; Routes.Children.Add (res); return res; }
private RouteHandler AddImplicitRouteHandlerForModule(IManosModule module, IMatchOperation [] ops, HttpMethod [] methods) { module.StartInternal (); module.Routes.IsImplicit = true; module.Routes.MatchOps = ops; module.Routes.Methods = methods; Routes.Children.Add (module.Routes); return module.Routes; }
public RouteHandler(IMatchOperation op, HttpMethod method, IManosTarget target) : this(new IMatchOperation [] { op }, new HttpMethod [] { method }, target) { }
public RouteHandler(IMatchOperation op, HttpMethod method) : this(new IMatchOperation [] { op }, new HttpMethod [] { method }) { }
public RouteHandler(IMatchOperation op, HttpMethod [] methods, IManosTarget target) : this(new IMatchOperation [] { op }, methods, target) { }
public RouteHandler(IMatchOperation op, HttpMethod [] methods) : this(new IMatchOperation [] { op }, methods) { }
public void Create_SimpleMatchInMiddle_CreatesSimpleMatch() { IMatchOperation op = MatchOperationFactory.Create("/Foo/{bar}/"); Should.BeInstanceOf <SimpleMatchOperation> (op); }
public void Create_EscapedCloseSimpleMatch_CreatesStringMatch() { IMatchOperation op = MatchOperationFactory.Create("{bar}}"); Should.BeInstanceOf <StringMatchOperation> (op); }
public void Create_SimpleMatchIsWholePattern_CreatesSimpleMatch() { IMatchOperation op = MatchOperationFactory.Create("{bar}"); Should.BeInstanceOf <SimpleMatchOperation> (op); }
public void Create_SimpleMatchAtBeginning_CreatesSimpleMatch() { IMatchOperation op = MatchOperationFactory.Create("{bar}/Foo"); Should.BeInstanceOf <SimpleMatchOperation> (op); }