Beispiel #1
0
 public virtual void ProcessData(RoutePath path, RouteData data)
 {
     ConsumePath(path);
     foreach (var item in RouteData)
     {
         data[item.Key] = item.Value;
     }
 }
Beispiel #2
0
        public override void ProcessData(RoutePath path, RouteData data)
        {
            base.ProcessData(path, data);

            var part = path.Consume();
            part = HttpUtility.UrlDecode(part);
            var value = Convert.ChangeType(part, Parameter.ParameterType);
            data[Parameter.Name] = value;
        }
Beispiel #3
0
        public RouteData Apply(string path, string method)
        {
            path = path.ChopEnd("/");
            var routePath = new RoutePath(path.ToLower());
            var route = CalculateRoute(path, method);
            if (route == null)
            {
                throw new InvalidOperationException("Could not apply the URL path '" + path + "'.  No route supports this path.");
            }

            var routeData = new RouteData();
            routePath = new RoutePath(path);

            foreach (var part in route)
            {
                part.ProcessData(routePath, routeData);
            }

            return routeData;
        }
Beispiel #4
0
 public override void ProcessData(RoutePath path, RouteData data)
 {
     base.ProcessData(path, data);
     var s = path.ConsumeAll();
     data[parameter.Name] = Convert.ChangeType(s, parameter.ParameterType);
 }