/// <inheritdoc/>
 public bool TrySaveRepository(NoteRepositoryModel repositoryModel)
 {
     try
     {
         string xmlFilePath = Path.Combine(GetDirectoryPath(), Config.RepositoryFileName);
         bool   success     = _xmlFileService.TrySerializeAndSave(xmlFilePath, repositoryModel);
         if (success)
         {
             _cachedRepository = repositoryModel;
         }
         return(success);
     }
     catch (Exception)
     {
         return(false);
     }
 }
Esempio n. 2
0
 /// <inheritdoc/>
 public bool TrySaveSettingsToLocalDevice(SettingsModel model)
 {
     try
     {
         BeforeSaving(model);
         string xmlFilePath = Path.Combine(GetDirectoryPath(), Config.UserSettingsFileName);
         bool   success     = _xmlFileService.TrySerializeAndSave(xmlFilePath, model);
         if (success)
         {
             _cachedSettings = model;
         }
         return(success);
     }
     catch (Exception)
     {
         return(false);
     }
 }