public Dictionary <DateTime, List <FileData> > GetDictionaryFromJson() { JsonAdapter <BackupsLog> jsonAdapter = new JsonAdapter <BackupsLog>(); BackupFolder mainFloder = new BackupFolder(); BackupsLog backupsLog = jsonAdapter.ReadFromJsonFile() ?? new BackupsLog(); return(backupsLog.BackupsLogDictionary); }
private void CommitNewChanges() { try { BackupFolder backupFolder = new BackupFolder(); List <FileData> bacupsList = backupFolder.TxtFiles; _backupsLog.AddChangesToDictionary(DateTime.Now, bacupsList); JsonAdapter <BackupsLog> jsonAdapter = new JsonAdapter <BackupsLog>(); jsonAdapter.SaveToJsonFile(_backupsLog); } catch (Exception ex) { Console.WriteLine("The process failed: {0}{1}{2}", ex.Message, Environment.NewLine, ex.StackTrace); } }