示例#1
0
        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);
        }
示例#2
0
        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);
            }
        }