Exemple #1
0
        public static async Task <LocalStorageValue <T> > CreateAsync(string keyname, ILocalStorageService localStorage)
        {
            var ret = new LocalStorageValue <T>(keyname, localStorage);
            var _   = await ret.RefreshValueAsync();

            return(ret);
        }
Exemple #2
0
 public AppData(ILocalStorageService localStorage, NavigationManager navManager)
 {
     this.localStore = localStorage;
     this.navManager = navManager;
     PastHour        = new LocalStorageValue <bool>("PastHour", localStore);
     Bearer          = new LocalStorageValue <string>("AwairBearerToken", localStore);
     constructTime   = DateTime.Now;
 }
Exemple #3
0
 public async Task AssignDeviceColors(QuickType.Devices devices)
 {
     foreach (var d in devices.DevicesDevices)
     {
         var colorval = new LocalStorageValue <int>($"{d.DeviceUuid}_Color", localStore);
         if (await colorval.Exists())
         {
             d.Color = Color.FromArgb(await colorval.RefreshValueAsync());
         }
         else
         {
             // save a new random color for this device
             await colorval.SetValueAsync(d.RandomizeColor().ToArgb());
         }
     }
 }