A pre-packaged set of routes/actions that can be registered in the constructor of a ManoApp-derived class.
Inheritance: IManosModule
Ejemplo n.º 1
0
 private RouteHandler AddImplicitRouteHandler(ManosModule module, string [] patterns, HttpMethod [] methods)
 {
     module.Routes.IsImplicit = true;
     module.Routes.Patterns   = patterns;
     module.Routes.Methods    = methods;
     Routes.Children.Add(module.Routes);
     return(module.Routes);
 }
Ejemplo n.º 2
0
        public void TestAddRouteNull()
        {
            ManosModule m = new ManosModule ();

            Should.Throw<ArgumentNullException> (() => m.Route (new ManosModule (), null, null));
            Should.Throw<ArgumentNullException> (() => m.Route (new ManosAction (FakeAction), null, null));
            Should.Throw<ArgumentNullException> (() => m.Route (null, new ManosAction (FakeAction)));
            Should.Throw<ArgumentNullException> (() => m.Route (null, new ManosModule ()));
        }
Ejemplo n.º 3
0
        private RouteHandler AddRouteHandler(ManosModule module, string [] patterns, HttpMethod [] methods)
        {
            if (module == null)
            {
                throw new ArgumentNullException("module");
            }
            if (patterns == null)
            {
                throw new ArgumentNullException("patterns");
            }
            if (methods == null)
            {
                throw new ArgumentNullException("methods");
            }

            module.Routes.Patterns = patterns;
            module.Routes.Methods  = methods;
            Routes.Children.Add(module.Routes);
            return(module.Routes);
        }
Ejemplo n.º 4
0
 public RouteHandler Trace(ManosModule module, params string [] patterns)
 {
     return(AddRouteHandler(module, patterns, HttpMethods.TraceMethods));
 }
Ejemplo n.º 5
0
        //

        public RouteHandler Trace(string pattern, ManosModule module)
        {
            return(AddRouteHandler(module, new string [] { pattern }, HttpMethods.TraceMethods));
        }
Ejemplo n.º 6
0
 public RouteHandler Options(ManosModule module, params string [] patterns)
 {
     return(AddRouteHandler(module, patterns, HttpMethods.OptionsMethods));
 }
Ejemplo n.º 7
0
        //

        public RouteHandler Options(string pattern, ManosModule module)
        {
            return(AddRouteHandler(module, new string [] { pattern }, HttpMethods.OptionsMethods));
        }
Ejemplo n.º 8
0
 public RouteHandler Get(string pattern, ManosModule module)
 {
     return AddRouteHandler (module, new string [] { pattern }, HttpMethods.GetMethods);
 }
Ejemplo n.º 9
0
 public RouteHandler Delete(ManosModule module, params string [] patterns)
 {
     return AddRouteHandler (module, patterns, HttpMethods.DeleteMethods);
 }
Ejemplo n.º 10
0
        private RouteHandler AddRouteHandler(ManosModule module, string [] patterns, string [] methods)
        {
            if (module == null)
                throw new ArgumentNullException ("module");
            if (patterns == null)
                throw new ArgumentNullException ("patterns");
            if (methods == null)
                throw new ArgumentNullException ("methods");

            module.Routes.Patterns = patterns;
            module.Routes.Methods = methods;
            Routes.Children.Add (module.Routes);
            return module.Routes;
        }
Ejemplo n.º 11
0
 private RouteHandler AddImplicitRouteHandler(ManosModule module, string [] patterns, string [] methods)
 {
     module.Routes.IsImplicit = true;
     module.Routes.Patterns = patterns;
     module.Routes.Methods = methods;
     Routes.Children.Add (module.Routes);
     return module.Routes;
 }
Ejemplo n.º 12
0
 public RouteHandler Post(ManosModule module, params string [] patterns)
 {
     return AddRouteHandler (module, patterns, HttpMethods.PostMethods);
 }
Ejemplo n.º 13
0
 public RouteHandler Options(ManosModule module, params string [] patterns)
 {
     return AddRouteHandler (module, patterns, HttpMethods.OptionsMethods);
 }
Ejemplo n.º 14
0
 //
 public RouteHandler Options(string pattern, ManosModule module)
 {
     return AddRouteHandler (module, new string [] { pattern }, HttpMethods.OptionsMethods);
 }