/// <summary> /// 创建一个新的路由条目 /// </summary> /// <param name="url"></param> /// <param name="action"></param> public Route(Uri uri, RouteAction action) { this.uri = uri; this.action = action; options = new RouteOptions(); options.OnCompiledChange += ClearCompile; }
/// <summary> /// 产生一个路由条目 /// </summary> /// <param name="uri">uri</param> /// <param name="action">路由行为</param> /// <returns>路由条目</returns> private Route MakeRoute(Uri uri, RouteAction action) { var route = new Route(uri, action); route.SetRouter(this); route.SetContainer(container); return(route); }
/// <summary> /// 产生一个路由条目 /// </summary> /// <param name="uri">uri</param> /// <param name="action">路由行为</param> /// <returns>路由条目</returns> private Route MakeRoute(Uri uri, RouteAction action) { var route = new Route(uri, action); route.SetRouter(this); route.SetScheme(schemes[uri.Scheme]); route.SetFilterChain(filterChain); route.SetContainer(container); return(route); }
/// <summary> /// 注册一个路由方案 /// </summary> /// <param name="uris">统一资源标识符</param> /// <param name="action">行为</param> /// <returns>当前实例</returns> private IRoute RegisterRoute(string uris, RouteAction action) { uris = GuardUri(uris); var uri = new Uri(uris); if (!schemes.ContainsKey(uri.Scheme)) { CreateScheme(uri.Scheme); } var route = MakeRoute(uri, action); schemes[uri.Scheme].AddRoute(route); if (routeGroupStack.Count > 0) { routeGroupStack.Peek().AddRoute(route); } return(route); }
/// <summary> /// 创建一个新的路由条目 /// </summary> /// <param name="url"></param> /// <param name="action"></param> public Route(Uri uri, RouteAction action) { this.uri = uri; this.action = action; options = new RouteOptions(); }