public RouteHandler(IMatchOperation [] ops, HttpMethod [] methods, IManosTarget target) { Target = target; match_ops = ops; this.methods = new List <HttpMethod> (methods); SetupChildrenCollection(); }
public RouteHandler(string [] patterns, HttpMethod [] methods, IManosTarget target) { Target = target; Patterns = new List <string> (patterns); this.methods = new List <HttpMethod> (methods); SetupChildrenCollection(); }
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 AddImplicitRouteHandler(IManosTarget target, string [] patterns, HttpMethod [] methods) { RouteHandler res = new RouteHandler(patterns, methods, target) { IsImplicit = true, }; Routes.Children.Add(res); return(res); }
private IManosTarget Find(IHttpRequest request, int uri_start) { if (!IsMethodMatch(request)) { return(null); } DataDictionary uri_data = null; if (HasPatterns) { int end; if (!FindPatternMatch(request.Path, uri_start, out uri_data, out end)) { return(null); } if (Target != null) { if (uri_data != null) { request.UriData.Children.Add(uri_data); } return(Target); } uri_start = end; } foreach (RouteHandler handler in Children) { IManosTarget res = handler.Find(request, uri_start); if (res != null) { if (uri_data != null) { request.UriData.Children.Add(uri_data); } return(res); } } return(null); }
private void PipePostProcessTarget(IManosTarget handler) { if (null != AppHost.Pipes) { // reset pending pipes pending = AppHost.Pipes == null ? 1 : AppHost.Pipes.Count; for (int i = AppHost.Pipes.Count - 1; i >= 0; --i) { IManosPipe pipe = AppHost.Pipes[i]; try { pipe.OnPostProcessTarget(ctx, handler, StepCompleted); } catch (Exception e) { Console.Error.WriteLine("Exception in {0}::OnPostProcessTarget.", pipe); Console.Error.WriteLine(e); } } } }
public void OnPostProcessTarget(IManosContext ctx, IManosTarget target) { if (AppHost.Pipes == null) { return; } foreach (IManosPipe pipe in AppHost.Pipes) { try { pipe.OnPostProcessTarget(ctx, target); if (ctx.Transaction.Aborted) { return; } } catch (Exception e) { Console.Error.WriteLine("Exception in {0}::OnPostProcessTarget.", pipe); Console.Error.WriteLine(e); } } }
private RouteHandler AddRouteHandler(IManosTarget target, string [] patterns, HttpMethod [] methods) { // TODO: Need to decide if this is a good or bad idea // RemoveImplicitHandlers (action); if (target == null) { throw new ArgumentNullException("action"); } if (patterns == null) { throw new ArgumentNullException("patterns"); } if (methods == null) { throw new ArgumentNullException("methods"); } RouteHandler res = new RouteHandler(patterns, methods, target); Routes.Children.Add(res); return(res); }
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 AddImplicitRouteHandlerForTarget(IManosTarget target, string[] patterns, HttpMethod[] methods, MatchType matchType) { return AddImplicitRouteHandlerForTarget (target, OpsForPatterns (patterns, matchType), methods); //return AddImplicitRouteHandlerForTarget (target, StringOpsForPatterns (patterns), 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 void PipePostProcessTarget(IManosTarget handler) { if (null != AppHost.Pipes) { // reset pending pipes pending = AppHost.Pipes == null ? 1 : AppHost.Pipes.Count; for (int i = AppHost.Pipes.Count - 1; i >= 0 ; --i) { IManosPipe pipe = AppHost.Pipes[i]; try { pipe.OnPostProcessTarget (ctx, handler, StepCompleted); } catch (Exception e) { Console.Error.WriteLine ("Exception in {0}::OnPostProcessTarget.", pipe); Console.Error.WriteLine (e); } } } }
public virtual void OnPostProcessTarget(IManosContext ctx, IManosTarget target, Action complete) { complete(); }
public RouteHandler(string pattern, HttpMethod [] methods, IManosTarget target) : this(new string [] { pattern }, methods, target) { }
public virtual void OnPostProcessTarget(IManosContext ctx, IManosTarget target) { }
public RouteHandler(IMatchOperation op, HttpMethod [] methods, IManosTarget target) : this(new IMatchOperation [] { op }, methods, target) { }
public RouteHandler(IMatchOperation op, HttpMethod method, IManosTarget target) : this(new IMatchOperation [] { op }, new HttpMethod [] { method }, target) { }
public RouteHandler(string pattern, HttpMethod method, IManosTarget target) : this(new string [] { pattern }, new HttpMethod [] { method }, target) { }
private RouteHandler AddRouteHandler(IManosTarget target, string [] patterns, HttpMethod [] methods) { // TODO: Need to decide if this is a good or bad idea // RemoveImplicitHandlers (action); if (target == null) throw new ArgumentNullException ("action"); if (patterns == null) throw new ArgumentNullException ("patterns"); if (methods == null) throw new ArgumentNullException ("methods"); RouteHandler res = new RouteHandler (SimpleOpsForPatterns (patterns), methods, target); Routes.Children.Add (res); return res; }
public virtual void OnPostProcessTarget(IManosContext ctx, IManosTarget target, Action complete) { complete (); }
private RouteHandler AddImplicitRouteHandler(IManosTarget target, string [] patterns, string [] methods) { RouteHandler res = new RouteHandler (patterns, methods, target) { IsImplicit = true, }; Routes.Children.Add (res); return res; }
public void OnPostProcessTarget(IManosContext ctx, IManosTarget target) { if (AppHost.Pipes == null) return; foreach (IManosPipe pipe in AppHost.Pipes) { try { pipe.OnPostProcessTarget (ctx, target); if (ctx.Transaction.Aborted) return; } catch (Exception e) { Console.Error.WriteLine ("Exception in {0}::OnPostProcessTarget.", pipe); Console.Error.WriteLine (e); } } }
private RouteHandler AddImplicitRouteHandlerForTarget(IManosTarget target, string[] patterns, HttpMethod[] methods, MatchType matchType) { return(AddImplicitRouteHandlerForTarget(target, OpsForPatterns(patterns, matchType), methods)); //return AddImplicitRouteHandlerForTarget (target, StringOpsForPatterns (patterns), methods); }