public WebServer(int port, IHandleable mvcRequestHandler)
        {
            this.port     = port;
            this.listener = new TcpListener(IPAddress.Parse(localHostIpAddress), port);

            this.mvcRequestHandler = mvcRequestHandler;
        }
        public ConnectionHandler(Socket client, IHandleable mvcRequestHandler)
        {
            CoreValidator.ThrowIfNull(client, nameof(client));
            CoreValidator.ThrowIfNull(mvcRequestHandler, nameof(mvcRequestHandler));

            this.client            = client;
            this.mvcRequestHandler = mvcRequestHandler;
        }
Exemple #3
0
        public WebServer(int port, IHandleable requestHandler, IHandleable resourceHandler)
        {
            this.port     = port;
            this.listener = new TcpListener(IPAddress.Parse(LocalHostIpAddress), port);

            this.requestHandler  = requestHandler;
            this.resourceHandler = resourceHandler;
        }
Exemple #4
0
        public HttpServer(int port, IHandleable requestHandler, IHandleable resourceHandler)
        {
            this.port            = port;
            this.requestHandler  = requestHandler;
            this.resourceHandler = resourceHandler;

            this.listener = new TcpListener(IPAddress.Parse("127.0.0.1"), port);
        }
Exemple #5
0
        //private readonly SkyboxRotationAxis _rotationAxis;

        public Skybox(
            IHandleable prop /*, float rotationSpeed = 0*/ /*, SkyboxRotationAxis rotationAxis = SkyboxRotationAxis.Z*/)
            : base(prop.Handle)
        {
            //SkyboxRotationSpeed = rotationSpeed;

            //_rotationAxis = rotationAxis;
        }
        public bool Equals(IHandleable other)
        {
            if (other == null || !(other is LoopedParticle))
            {
                return(false);
            }

            return(this.Handle == ((LoopedParticle)other).Handle);
        }
Exemple #7
0
        public ConnectionHandler(Socket client, IHandleable requestHandler, IHandleable resourceHandler)
        {
            CoreValidator.ThrowIfNull(client, nameof(client));
            CoreValidator.ThrowIfNull(requestHandler, nameof(requestHandler));
            CoreValidator.ThrowIfNull(resourceHandler, nameof(resourceHandler));

            this.client          = client;
            this.requestHandler  = requestHandler;
            this.resourceHandler = resourceHandler;
        }
        public WebServer(int port, IHandleable mvcRequestHandler, IHandleable resourceHandler)
        {
            this.port        = port;
            this.tcpListener = new TcpListener(IPAddress.Parse(localHostIpAddress), port);

            CoreValidator.ThrowIfNull(mvcRequestHandler, nameof(mvcRequestHandler));
            CoreValidator.ThrowIfNull(resourceHandler, nameof(resourceHandler));

            this.mvcRequestHandler = mvcRequestHandler;
            this.resourceHandler   = resourceHandler;
        }
Exemple #9
0
 public AttachedOrbital(IHandleable prop, Vector3 attachOffset, Vector3 attachRotation,
                        bool freezeX, bool freezeY, bool freezeZ,
                        bool shiftX, bool shiftY, bool shiftZ,
                        float shiftAmount)
     : base(prop.Handle)
 {
     AttachOffset   = attachOffset;
     AttachRotation = attachRotation;
     FreezeX        = freezeX;
     FreezeY        = freezeY;
     FreezeZ        = freezeZ;
     ShiftAmount    = shiftAmount;
     ShiftX         = shiftX;
     ShiftY         = shiftY;
     ShiftZ         = shiftZ;
 }
Exemple #10
0
        public void AddRoute(string route, IHandleable handler)
        {
            handler = handler.EnsureNotNull();

            var handlerMethod = handler.GetType().Name.Replace("Handler", string.Empty);

            if (!Enum.TryParse(handlerMethod, true, out HttpMethod method))
            {
                throw new InvalidOperationException("Invalid handler providet.");
            }

            if (this.routes.ContainsKey(method))
            {
                this.routes[method][route] = handler;
            }
        }
Exemple #11
0
 public SupplierOutput Get(string id,
                           [FromServices] IHandleable <string, SupplierOutput> usecase)
 {
     return(usecase.Handle(id));
 }
Exemple #12
0
 public Server(int port, IHandleable handler, IHandleable resourceRouter)
     : this(port)
 {
     this.handler        = handler;
     this.resourceRouter = resourceRouter;
 }
Exemple #13
0
 public Server(int port, ServerRoutingTable serverRoutingTable, IHandleable resourceRouter)
     : this(port)
 {
     this.serverRoutingTable = serverRoutingTable;
     this.resourceRouter     = resourceRouter;
 }
Exemple #14
0
 public ConnectionHandler(Socket client, IHandleable handler, IHandleable resourceRouter)
     : this(client)
 {
     this.handler        = handler;
     this.resourceRouter = resourceRouter;
 }
Exemple #15
0
 public ConnectionHandler(Socket client, ServerRoutingTable serverRoutingTable, IHandleable resourceRouter)
     : this(client)
 {
     this.serverRoutingTable = serverRoutingTable;
     this.resourceRouter     = resourceRouter;
 }
Exemple #16
0
 public RoutingContext(IHandleable handler, IEnumerable <string> parameters)
 {
     this.Handler    = handler.EnsureNotNull() as IHandleable;
     this.Parameters = parameters.EnsureNotNull() as IEnumerable <string>;
 }
Exemple #17
0
 public HttpServerEngine(IHandleable handler)
 {
     this.isRunning   = false;
     this.handler     = handler;
     this.tcpListener = HttpListener.TcpListener();
 }
 public ConnectionHandler(Socket client, IHandleable requestHandler, IHandleable resourceHandler)
 {
     this.client          = client;
     this.requestHandler  = requestHandler;
     this.resourceHandler = resourceHandler;
 }
Exemple #19
0
 public SupplierIdOutput Post([FromBody] SupplierInput input,
                              [FromServices] IHandleable <SupplierInput, SupplierIdOutput> usecase)
 {
     return(usecase.Handle(input));
 }
Exemple #20
0
 public ConnectionHandler(Socket client, IHandleable handler)
 {
     this.client  = client;
     this.handler = handler;
 }
Exemple #21
0
 public bool Equals(IHandleable other)
 {
     return Handle == other.Handle;
 }
Exemple #22
0
 public Surface(IHandleable prop, float tileSize, int dimensions) : base(prop.Handle)
 {
     _tileSize   = tileSize;
     _dimensions = dimensions;
 }
Exemple #23
0
 public bool Equals(IHandleable other) => ReferenceEquals(other, this);