Exemplo n.º 1
0
        private void initialChainLinksFeatures()
        {
            m_PostHandlerChain = new ChainPostHandler
            {
                PostHandler = new ApplyShortcutsPostHandler(r_ShortcutsToReplace)
                {
                    Enabled = true,
                },
                NextPostHandler = new ChainPostHandler
                {
                    PostHandler = new CheckNetworkPostHandler
                    {
                        Enabled      = true,
                        LoggedInUser = m_LoggedInUser,
                    },
                }
            };

            foreach (IPostHandler postHandler in m_PostHandlerChain)
            {
                ToolStripButton postHandlerButton = new ToolStripButton(postHandler.Name);
                postHandlerButton.Click  += (i_Sender, i_Args) => postHandlerButton.Checked = !postHandlerButton.Checked;
                postHandlerButton.Checked = postHandler.Enabled;
                IPostHandler handler = postHandler;
                postHandlerButton.CheckStateChanged += (i_Sender, i_Args) => handler.Enabled = ((ToolStripButton)i_Sender).Checked;
                contextMenuPostHandlers.Items.Add(postHandlerButton);
            }
        }
Exemplo n.º 2
0
 public InMemoryWebServer(ILogger logger, WebServerLocation webServerLocation, ResponseFactory responseFactory, IPostHandler postHandler)
 {
     _logger = logger;
     _webServerLocation = webServerLocation;
     _postHandler = postHandler;
     _responseFactory = responseFactory;
 }
Exemplo n.º 3
0
 public InMemoryWebServer(ILogger logger, WebServerLocation webServerLocation, ResponseFactory responseFactory, IPostHandler postHandler)
 {
     _logger            = logger;
     _webServerLocation = webServerLocation;
     _postHandler       = postHandler;
     _responseFactory   = responseFactory;
 }
Exemplo n.º 4
0
        public bool Start(int port, IPostHandler externalPostHandler)
        {
            if (this.IsRunning)
            {
                return(false);
            }

            this.Port = port;
            return(Start(externalPostHandler));
        }
Exemplo n.º 5
0
        public bool Start(IPostHandler externalPostHandler)
        {
            if (this.IsRunning)
            {
                return(false);
            }

            DIContainerProvider.RenewOwinContainer();
            DIContainerProvider.OwinContainer.Register <IPostHandler>(() => externalPostHandler, (Lifestyle.Scoped));

            StartOptions options = new StartOptions();

            options.Urls.Add(this.BaseAddress1);
            options.Urls.Add(this.BaseAddress2);

            this.Server = WebApp.Start <Startup>(options);
            return(true);
        }
Exemplo n.º 6
0
        public bool Start(IPostHandler externalPostHandler)
        {
            if (this.IsRunning)
            {
                return(false);
            }

            // Prepare the DI-Container to inject the externalPostHandler-Instance into the Controller
            DIContainerProvider.RenewOwinContainer();
            DIContainerProvider.OwinContainer.Register <IPostHandler>(() => externalPostHandler, (Lifestyle.Scoped));

            // Start the ASP.NET WebApi
            StartOptions options = new StartOptions();

            options.Urls.Add(this.BaseAddress);
            this.ServerAsp = WebApp.Start <Startup>(options);

            return(true);
        }
Exemplo n.º 7
0
 public FacesController()
 {
     _ph = new PostHandler(new FileFaceReader(), new FileFaceWriter(), new APIRecognizer(new FacePlusRequest()), new RegisterService(), new LoginService(), new BookService());
 }
 public ValuesController(IPostHandler postHandler)
 {
     this.PostHandler = postHandler;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="MetricsBasedWatchListController" /> class.
 /// </summary>
 /// <param name="metricsBasedWatchListService">The metrics based watch list service.</param>
 /// <param name="metricsBasedWatchListPostHandler">The metrics based watch list post handler.</param>
 public MetricsBasedWatchListController(IService<MetricsBasedWatchListGetRequest, EdFiGridWatchListModel> metricsBasedWatchListService,
     IPostHandler<MetricsBasedWatchListPostRequest, string> metricsBasedWatchListPostHandler)
 {
     MetricsBasedWatchListService = metricsBasedWatchListService;
     MetricsBasedWatchListPostHandler = metricsBasedWatchListPostHandler;
 }
 public FacesController()
 {
     _ph = WebApiApplication.container.Resolve <IPostHandler>();
 }
Exemplo n.º 11
0
 public PostController(IPostHandler postHandler)
 {
     _postHandler = postHandler;
 }
Exemplo n.º 12
0
 public RegistrationController(IPostHandler postHandler, IDeleteService deleteService)
 {
     _postHandler   = postHandler;
     _deleteService = deleteService;
 }
Exemplo n.º 13
0
 public void AddHandler(IPostHandler <TRequest, TResponse> handler)
 {
     ListPostHandlers.Add(handler);
 }
 public RegistrationController()
 {
     _ph = WebApiApplication.container.Resolve <IPostHandler>();
 }
Exemplo n.º 15
0
 public void SetNextPostType(IPostHandler postHandler)
 {
     this.postHandler = postHandler;
 }