예제 #1
0
        public static Route MapEyePatchRoute(this RouteCollection routes, string name, string url, object defaults,
                                             object constraints, string[] namespaces)
        {
            if (routes == null)
            {
                throw new ArgumentNullException("routes");
            }
            if (url == null)
            {
                throw new ArgumentNullException("url");
            }

            var route2 = new ManagedRoute(url, new MvcRouteHandler())
            {
                Defaults    = new RouteValueDictionary(defaults),
                Constraints = new RouteValueDictionary(constraints),
                DataTokens  = new RouteValueDictionary(),
            };

            if ((namespaces != null) && (namespaces.Length > 0))
            {
                route2.DataTokens["Namespaces"] = namespaces;
            }

            routes.Add(name, route2);
            return(route2);
        }
예제 #2
0
        public static Route MapEyePatchRoute(this RouteCollection routes, string name, string url, object defaults,
                                             object constraints, string[] namespaces)
        {
            if (routes == null)
                throw new ArgumentNullException("routes");
            if (url == null)
                throw new ArgumentNullException("url");

            var route2 = new ManagedRoute(url, new MvcRouteHandler())
                             {
                                 Defaults = new RouteValueDictionary(defaults),
                                 Constraints = new RouteValueDictionary(constraints),
                                 DataTokens = new RouteValueDictionary(),
                             };

            if ((namespaces != null) && (namespaces.Length > 0))
                route2.DataTokens["Namespaces"] = namespaces;

            routes.Add(name, route2);
            return route2;
        }