コード例 #1
0
ファイル: FileHistory.cs プロジェクト: foxscore/TabbedEditor
 public static void ResetHistory()
 {
     AppData.DeleteFile(HistoryFile);
     _history.Clear();
     FileHistoryChanged?.Invoke();
 }
コード例 #2
0
ファイル: FileHistory.cs プロジェクト: foxscore/TabbedEditor
 public static void Load()
 {
     try
     {
         if (AppData.FileExists(HistoryFile))
         {
             _history = JsonConvert.DeserializeObject <SerializableFileHistory>(AppData.ReadFile(HistoryFile)).Entries.ToList();
         }
     }
     catch (Exception e)
     {
         if (MessageBox.Show("Could not load file history!\nDo you want to reset it?", "Tabbed Editor - History", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
         {
             ResetHistory();
         }
         Logger.DumpException(e);
     }
     FileHistoryChanged?.Invoke();
 }