public PowerLineEndPointExecutionResult(PowerLinExecutionResultType resultType, PowerLineContext context, Exception exception, PowerLineEndPoint endpoint, PowerLineHandler handler)
 {
     this.ResultType = resultType;
     this.Context    = context;
     this.Exception  = exception;
     this.EndPoint   = endpoint;
     this.Handler    = handler;
 }
Ejemplo n.º 2
0
 public PowerLineHandler SetHandler(PowerLineHandler handler)
 {
     if (this.handlers.ContainsKey(handler.HttpMethod))
     {
         this.handlers[handler.HttpMethod] = handler;
         return(handler);
     }
     else
     {
         return(this.AddHandler(handler));
     }
 }
Ejemplo n.º 3
0
        public PowerLineEndPoint AddHandler(string endpointName, string httpMethod, Func <PowerLineContext, Task> func)
        {
            PowerLineHandler mainHandler = PowerLineHandler.Create(httpMethod, func);

            if (this.GetEndPoint(endpointName, out PowerLineEndPoint endpoint))
            {
                endpoint.SetHandler(mainHandler);
                return(endpoint);
            }
            else
            {
                return(this.AddEndpoint(endpointName, mainHandler));
            }
        }
Ejemplo n.º 4
0
 public PowerLineShadowHandler(string httpMethod, PowerLineHandler baseHandler) : base(httpMethod)
 {
     this.BaseHandler = baseHandler;
 }
Ejemplo n.º 5
0
 public PowerLineHandler AddHandler(PowerLineHandler handler)
 {
     this.handlers.Add(handler.HttpMethod, handler);
     return(handler);
 }
 public PowerLineEndPointExecutionResult(PowerLineContext context, PowerLineEndPoint endPoint, PowerLineHandler handler) : this(PowerLinExecutionResultType.OK, context, null, endPoint, handler)
 {
 }
 public PowerLineEndPointExecutionResult(PowerLineContext context, PowerLineEndPoint endPoint, PowerLineHandler handler, Exception exception) : this(PowerLinExecutionResultType.HandlerException, context, exception, endPoint, handler)
 {
 }