Beispiel #1
0
 static DataService()
 {
     Barrel.ApplicationId = AppInfo.PackageName;
     barrel     = Barrel.Create(FileSystem.AppDataDirectory);
     myCI       = new CultureInfo("en-US");
     myCWR      = myCI.DateTimeFormat.CalendarWeekRule;
     myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
 }
 public DataService()
 {
     client = new HttpClient()
     {
         BaseAddress = new Uri(App.BaseUrl)
     };
     Barrel.ApplicationId = AppInfo.PackageName;
     barrel = Barrel.Create(FileSystem.AppDataDirectory);
 }
Beispiel #3
0
 static DataService()
 {
     Barrel.ApplicationId = AppInfo.PackageName;
     Debug.WriteLine(AppInfo.PackageName);
     _barrel     = Barrel.Create(FileSystem.AppDataDirectory);
     _myCI       = new CultureInfo("ja-JP");
     _myCWR      = _myCI.DateTimeFormat.CalendarWeekRule;
     _myFirstDOW = _myCI.DateTimeFormat.FirstDayOfWeek;
 }
Beispiel #4
0
        public DataService()
        {
            client = new HttpClient()
            {
                BaseAddress = new Uri(App.BaseUrl)
            };

            Barrel.ApplicationId = AppInfo.PackageName;
            barrel     = Barrel.Create(FileSystem.AppDataDirectory);
            myCI       = new CultureInfo("en-US");
            myCWR      = myCI.DateTimeFormat.CalendarWeekRule;
            myFirstDOW = myCI.DateTimeFormat.FirstDayOfWeek;
        }
        public Covid19JapanApiManager()
        {
            //HttpClientの生成
            //Covid19JapanApiManagerクラスはDependencyService経由でインスタンスを取得するので
            //1回しか生成されないので大丈夫.
            this._httpClient = new HttpClient
            {
                BaseAddress = new Uri("https://covid19-japan-web-api.now.sh/api/v1/")
            };

            //MonkeyCacheの初期化
            Barrel.ApplicationId = AppInfo.PackageName;
            this._barrel         = Barrel.Create(FileSystem.AppDataDirectory);
        }
        public void MonkeyCache_FileStore()
        {
            var barrel = Barrel.Create(DirectoryPath);

            LoopAction(Iterations, () =>
            {
                barrel.Add("TestKey", 123, TimeSpan.FromDays(1));
                barrel.Get <int>("TestKey");

                var getOrSetResult = barrel.Get <string>("GetOrSet_TestKey");
                if (getOrSetResult == null)
                {
                    barrel.Add("GetOrSet_TestKey", "Hello World", TimeSpan.FromDays(1));
                }
            });
        }
Beispiel #7
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterSingleton <IAppInfo, AppInfoImplementation>();
            containerRegistry.RegisterForNavigation <NavigationPage>();
            containerRegistry.RegisterForNavigation <EquipmentPage, EquipmentPageViewModel>();
            containerRegistry.RegisterForNavigation <AddOrEditEquipmentPage, AddOrEditEquipmentPageViewModel>();
            containerRegistry.RegisterForNavigation <ViewEquipmentPage, ViewEquipmentPageViewModel>();
            containerRegistry.AutoRegisterByInterfaceName("IGetAll");
            containerRegistry.AutoRegisterByInterfaceName("IPost");
            containerRegistry.AutoRegisterByInterfaceName("IPut");
            containerRegistry.AutoRegisterByInterfaceName("IGet");
            Barrel.Create(OfflineDatabasePath());
            Barrel.ApplicationId = "LocalDb";

            containerRegistry.RegisterInstance(CrossMedia.Current);
            containerRegistry.RegisterInstance(Barrel.Current);
        }
Beispiel #8
0
        public override void SetupBarrel()
        {
            var dir = BarrelUtils.GetBasePath("com.refractored.monkeylite.customdir");

            this.barrel = Barrel.Create(dir, true);
        }
Beispiel #9
0
        public CacheRepository(string filename)
        {
            string databasePath = DependencyService.Get <ISQLite>().GetDatabasePath(filename);

            Barrel.Create(databasePath);
        }
 protected override void OnStart()
 {
     Barrel.Create(OfflineDatabasePath());
     Barrel.ApplicationId = "LocalDb";
 }