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); }
public static void RegisterRoute(string route, Type type) { if (!String.IsNullOrWhiteSpace(route)) { route = FormatRoute(route); } ValidateRoute(route); s_routes[route] = new TypeRouteFactory(type); }
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) { } }