A pre-packaged set of routes/actions that can be registered in the constructor of a ManoApp-derived class.
상속: IManosModule
예제 #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);
 }
예제 #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 ()));
        }
예제 #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);
        }
예제 #4
0
 public RouteHandler Trace(ManosModule module, params string [] patterns)
 {
     return(AddRouteHandler(module, patterns, HttpMethods.TraceMethods));
 }
예제 #5
0
        //

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

        public RouteHandler Options(string pattern, ManosModule module)
        {
            return(AddRouteHandler(module, new string [] { pattern }, HttpMethods.OptionsMethods));
        }
예제 #8
0
파일: ManosModule.cs 프로젝트: emiaj/manos
 public RouteHandler Get(string pattern, ManosModule module)
 {
     return AddRouteHandler (module, new string [] { pattern }, HttpMethods.GetMethods);
 }
예제 #9
0
파일: ManosModule.cs 프로젝트: emiaj/manos
 public RouteHandler Delete(ManosModule module, params string [] patterns)
 {
     return AddRouteHandler (module, patterns, HttpMethods.DeleteMethods);
 }
예제 #10
0
파일: ManosModule.cs 프로젝트: emiaj/manos
        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;
        }
예제 #11
0
파일: ManosModule.cs 프로젝트: emiaj/manos
 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;
 }
예제 #12
0
파일: ManosModule.cs 프로젝트: emiaj/manos
 public RouteHandler Post(ManosModule module, params string [] patterns)
 {
     return AddRouteHandler (module, patterns, HttpMethods.PostMethods);
 }
예제 #13
0
파일: ManosModule.cs 프로젝트: emiaj/manos
 public RouteHandler Options(ManosModule module, params string [] patterns)
 {
     return AddRouteHandler (module, patterns, HttpMethods.OptionsMethods);
 }
예제 #14
0
파일: ManosModule.cs 프로젝트: emiaj/manos
 //
 public RouteHandler Options(string pattern, ManosModule module)
 {
     return AddRouteHandler (module, new string [] { pattern }, HttpMethods.OptionsMethods);
 }