// Constructor
        public MainPage()
        {
            InitializeComponent();

            initTiSettings();

            Logger.init(settings);

            requestHandlers["download"]   = new DownloadRequestHandler();
            requestHandlers["file"]       = new FileRequestHandler();
            requestHandlers["log"]        = new LogRequestHandler();
            requestHandlers["reflection"] = new ReflectionRequestHandler(app, browser, root);

            xhrProxy = new XHRProxy(9999);
        }
Exemple #2
0
        private async void browser_Loaded(object sender, RoutedEventArgs e)
        {
            await Logger.init(settings);

            requestHandlers["download"]   = new DownloadRequestHandler();
            requestHandlers["file"]       = new FileRequestHandler();
            requestHandlers["log"]        = new LogRequestHandler();
            requestHandlers["reflection"] = new ReflectionRequestHandler(app, browser, root);

            // generate the security token
            this.securityToken          = Guid.NewGuid().ToString();
            this.xhrProxy.securityToken = this.securityToken;

            Logger.log("WebBrowser", "Browser loaded, opening index.html");

            browser.Navigate(new Uri("index.html#" + this.securityToken, UriKind.Relative));
        }
        public RoutineMiddleware(RequestDelegate next, IHttpContextAccessor httpContextAccessor, IJsonSerializer jsonSerializer, IServiceContext serviceContext)
        {
            this.next = next;

            rootPath                = serviceContext.ServiceConfiguration.GetPath();
            enableTestApp           = serviceContext.ServiceConfiguration.GetEnableTestApp();
            testAppPath             = serviceContext.ServiceConfiguration.GetPath(serviceContext.ServiceConfiguration.GetTestAppPath());
            indexHandler            = new IndexRequestHandler(serviceContext, jsonSerializer, httpContextAccessor);
            fileHandler             = new FileRequestHandler(serviceContext, jsonSerializer, httpContextAccessor);
            fontsHandler            = new FontsRequestHandler(serviceContext, jsonSerializer, httpContextAccessor);
            configurationHandler    = new ConfigurationRequestHandler(serviceContext, jsonSerializer, httpContextAccessor);
            applicationModelHandler = new ApplicationModelRequestHandler(serviceContext, jsonSerializer, httpContextAccessor);
            handleHandler           = new HandleRequestHandler(serviceContext, jsonSerializer, httpContextAccessor,
                                                               actionFactory: resolution => resolution.HasOperation
                    ? new DoRequestHandler(serviceContext, jsonSerializer, httpContextAccessor, resolution)
                    : new GetRequestHandler(serviceContext, jsonSerializer, httpContextAccessor, resolution)
                                                               );
        }