public AppSettings Load()
 {
     try
     {
         var data = storage.Get(settingsFilename);
         if (data == null)
         {
             var defaultSettings = CreateDefaultSettings();
             Save(defaultSettings);
             return(defaultSettings);
         }
         return(serializer.Deserialize <AppSettings>(data));
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, "Не удалось загрузить настройки");
         return(CreateDefaultSettings());
     }
 }
Пример #2
0
 public AppSettings Load()
 {
     try
     {
         settingsFilename = "app.settings";
         var data = storage.Get(settingsFilename);
         if (data == null)
         {
             var defaultSettings = CreateDefaultSettings();
             Save(defaultSettings);
             return(defaultSettings);
         }
         return(serializer.Deserialize <AppSettings>(data));
     }
     catch (Exception e)
     {
         MessageBox.Show(e.Message, "Error occured");
         return(CreateDefaultSettings());
     }
 }
Пример #3
0
 public IActionResult Get(string id)
 {
     return(Ok(_repo.Get(id, "Blob").Result));
 }
Пример #4
0
 public Task <T> ViewModel <T>(Guid userId)
 {
     return(_blobStorage.Get <T>(typeof(T).Name + "#" + userId));
 }
        public async Task <IActionResult> Get(string id)
        {
            var result = await _storage.Get(id);

            return(Ok(result));
        }