Пример #1
0
        public static void RegisterRoute(string route, Type type)
        {
            if (!ValidateRoute(route))
            {
                throw new ArgumentException("Route must contain only lowercase letters");
            }

            s_routes[route] = new TypeRouteFactory(type);
        }
Пример #2
0
        public static void RegisterRoute(string route, Type type)
        {
            if (!String.IsNullOrWhiteSpace(route))
            {
                route = FormatRoute(route);
            }

            ValidateRoute(route);

            s_routes[route] = new TypeRouteFactory(type);
        }
Пример #3
0
        private static void RegisterRoute <TPage>() where TPage : class
        {
            var page = typeof(TPage).Name.ToLower();

            Routing.UnRegisterRoute(page);

            var fac = new TypeRouteFactory(typeof(TPage));

            //Routing.RegisterRoute(page, new TypeRouteFactory(typeof(TPage)));
            try
            {
                Routing.RegisterRoute(page, fac);
                fac.GetOrCreate();
            }
            catch (Exception ex)
            {
            }
        }