Exemplo n.º 1
0
 public RequestHandler(Docs documentation, WebServerDelegate callback)
 {
     this.Callback      = callback;
     this.Documentation = documentation;
     try
     {
         this.MethodRegex   = new Regex(Documentation.method, RegexOptions.Compiled | RegexOptions.IgnoreCase);
         this.ResourceRegex = new Regex(parsePatternText(Documentation.requestPattern), RegexOptions.Compiled | RegexOptions.IgnoreCase);
     }
     catch (Exception ex)
     {
         throw new HttpException(HttpStatusCode.InternalServerError, "Unable to parse the docs for {0}. {1}", Documentation.name, ex.Message);
     }
 }
Exemplo n.º 2
0
 public RequestHandler(Docs documentation, WebServerDelegate callback)
 {
     this.Callback = callback;
     this.Documentation = documentation;
     try
     {
         this.MethodRegex = new Regex(Documentation.method, RegexOptions.Compiled | RegexOptions.IgnoreCase);
         this.ResourceRegex = new Regex(parsePatternText(Documentation.requestPattern), RegexOptions.Compiled | RegexOptions.IgnoreCase);
     }
     catch (Exception ex)
     {
         throw new HttpException(HttpStatusCode.InternalServerError, "Unable to parse the docs for {0}. {1}", Documentation.name, ex.Message);
     }
 }
Exemplo n.º 3
0
 public RequestHandler(WebServerDelegate callback)
     : this(((Docs[])callback.Method.GetCustomAttributes(typeof(Docs), false))[0], callback)
 {
 }
Exemplo n.º 4
0
 public RequestHandler(WebServerDelegate callback)
     : this(((Docs[])callback.Method.GetCustomAttributes(typeof(Docs), false))[0], callback)
 {
 }