Example #1
0
 public RegexRoute(Regex expression, RegexRouteHandler handler, object defaults)
 {
     Handler = handler;
     Expression = expression;
     DefaultGroups = new Dictionary<string, string>();
     if (defaults != null)
     {
         var properties = defaults.GetType().GetProperties();
         foreach (var prop in properties)
             DefaultGroups[prop.Name] = Convert.ToString(prop.GetValue(defaults, null));
     }
 }
Example #2
0
 public RegexRoute(string expression, RegexRouteHandler handler, object defaults)
     : this(new Regex("^" + expression + "/?$", RegexOptions.Compiled), handler, defaults)
 {
 }
Example #3
0
 public RegexRoute(Regex expression, RegexRouteHandler handler)
     : this(expression, handler, null)
 {
 }
Example #4
0
 public RegexRoute(string expression, RegexRouteHandler handler)
     : this(new Regex("^" + expression + "/?$", RegexOptions.Compiled), handler, null)
 {
 }