/// <summary> /// Add mapped routes. /// </summary> public void MapRoute(string name, string regex, DefaultRoute defaults) { MappedRoute mappedRoute = new MappedRoute(); mappedRoute.name = name; mappedRoute.regex = regex; mappedRoute.defaults = defaults; _mappedRoutes.Add(mappedRoute); }
/// <summary> /// Log the loaded routes. /// </summary> private void LogRoutes() { Logger.WriteInfo(this, "Ignored routes loaded from RouteConfig (HttpApplication) class:"); foreach (string pattern in _routes.IngoredRoutes) { Logger.WriteInfo(" route regex: '" + pattern + "'"); } Logger.WriteInfo(this, "Mapped routes loaded from RouteConfig (HttpApplication) class:"); foreach (MappedRoute items in _routes.MappedRoutes) { MappedRoute item = items; DefaultRoute route = item.defaults; Logger.WriteInfo(" route name: '" + item.name + "' regex: '" + item.regex + "' => default: {controller='" + route.controller + "' action='" + route.action + "' id='" + route.id + "'}" ); } }
/// <summary> /// Initializes a new instance of the <see cref="MatchResult"/> class. /// </summary> /// <param name="matchStatus"></param> /// <param name="mappedRoute"></param> public MatchResult(Match matchStatus, MappedRoute mappedRoute) { MatchStatus = matchStatus; MappedRoute = mappedRoute; }