Example #1
0
        public ReverseProxyMiddleware(RequestDelegate nextMiddleware)
        {
            _nextMiddleware = nextMiddleware;
            dynamic router = JsonLoader.LoadFromFile <dynamic>("routes.json");

            _routes = JsonLoader.Deserialize <List <Route> >(Convert.ToString(router.routes));
        }
Example #2
0
        public Router(string routeConfigFilePath)
        {
            var router = JsonLoader.LoadFromFile <dynamic>(routeConfigFilePath);

            Routes = JsonLoader.Deserialize <List <Route> >(Convert.ToString(router.routes));
            AuthenticationService = JsonLoader.Deserialize <Destination>(Convert.ToString(router.authenticationService));
        }
        public Router(string routeConfigFilePath, ILoggerManager logger)
        {
            dynamic router = JsonLoader.LoadFromFile <dynamic>(routeConfigFilePath);

            Routes = JsonLoader.Deserialize <List <Route> >(Convert.ToString(router.routes));
            AuthenticationService = JsonLoader.Deserialize <Destination>(Convert.ToString(router.authenticationService));
            this.logger           = logger;
        }
Example #4
0
    public void Load()
    {
        var path = Paths.GetPurchasedBundlesDataPath();

        m_data = JsonLoader.LoadFromFile <PurchasedBundlesData>(path);
        if (m_data == null)
        {
            m_data = new PurchasedBundlesData();
        }
    }
Example #5
0
    public static LevelProgress LoadOrCreate(string bundleId, string imageId)
    {
        if (string.IsNullOrEmpty(bundleId) ||
            string.IsNullOrEmpty(imageId))
        {
            return(null);
        }

        var path = GetFilePath(bundleId, imageId);

        var data = JsonLoader.LoadFromFile <LevelProgressData>(path);

        if (data == null)
        {
            data = new LevelProgressData();
        }

        return(Create(bundleId, imageId, data));
    }
Example #6
0
        /// <summary>
        /// Initializes a new instance of the <see cref="UsersService"/> class.
        /// </summary>
        public UsersService()
        {
            dynamic users = JsonLoader.LoadFromFile <dynamic>("users.json");

            this.Users = JsonLoader.Deserialize <List <User> >(Convert.ToString(users));
        }
Example #7
0
    public void Load()
    {
        var filePath = GetFilePath();

        m_data = JsonLoader.LoadFromFile <PersistentData>(filePath);
    }
Example #8
0
        public void Setup()
        {
            _loader = new JsonLoader();

            _router = _loader.LoadFromFile <dynamic>(@"Router\routes_test.json");
        }
Example #9
0
    public void Load()
    {
        var filePath = GetFilePath();

        m_data = JsonLoader.LoadFromFile <OptionsData>(filePath);
    }