Ejemplo n.º 1
0
        protected virtual bool Match(HttpContextBase context, Route route,
            ValueDictionary values, RouteDirection direction)
        {
            Precondition.Require(values, () => Error.ArgumentNull("values"));

            string value = values.GetValue<string>(_parameterName) ?? String.Empty;
            return _pattern.IsMatch(value);
        }
        protected virtual bool Match(HttpContextBase context, Route route, 
            ValueDictionary values, RouteDirection direction)
        {
            if (direction == RouteDirection.UrlGeneration)
                return true;

            Precondition.Require(context, () => Error.ArgumentNull("context"));
            return ((context.Request.HttpMethod & _methods) > 0);
        }
        public static Route MapPageRoute(this RouteCollection routes, string key,
            string url, string virtualPath)
        {
            Precondition.Require(routes, () => Error.ArgumentNull("routes"));
            Precondition.Require(url, () => Error.ArgumentNull("url"));

            Route route = new Route(url, new WebFormRoutingHandler(virtualPath));
            routes.Add(key, route);

            return route;
        }
Ejemplo n.º 4
0
 bool IRouteConstraint.Match(HttpContextBase context, Route route,
     ValueDictionary values, RouteDirection direction)
 {
     return Match(context, route, values, direction);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Initializes a new instance of the 
 /// <see cref="VirtualPathData"/> class
 /// </summary>
 /// <param name="route">An URL route</param>
 /// <param name="virtualPath">A virtual path string, 
 /// related to the supplied route</param>
 public VirtualPathData(Route route, string virtualPath)
 {
     _route = route;
     _virtualPath = virtualPath;
     _tokens = new ValueDictionary();
 }
Ejemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the
 /// <see cref="VirtualPathData"/> class
 /// </summary>
 /// <param name="route">An URL route</param>
 /// <param name="virtualPath">A virtual path string,
 /// related to the supplied route</param>
 public VirtualPathData(Route route, string virtualPath)
 {
     _route       = route;
     _virtualPath = virtualPath;
     _tokens      = new ValueDictionary();
 }