예제 #1
0
 /// <summary>
 /// Добавляє елемент в історію
 /// </summary>
 /// <param name="name"></param>
 /// <param name="path"></param>
 private static void AddToHistory(TextFile file)
 {
     if (!CheckForRepeat(file))
     {
         History.FilesList.Add(file);
         if (History.FilesList.Count > 10)
         {
             History.FilesList.RemoveAt(0);
         }
         HistoryChangedEvent?.Invoke();
     }
 }
예제 #2
0
 public static void RemoveFromHistory(TextFile file)
 {
     foreach (TextFile item in History.FilesList)
     {
         if (file.Path == item.Path)
         {
             History.FilesList.Remove(item);
             HistoryChangedEvent?.Invoke();
             return;
         }
     }
 }
예제 #3
0
 public static void FormLoad()
 {
     FileHistory.FileHandler = new XMLFileHandler();
     History = FileHistory.Load() ?? new TextFiles();
     HistoryChangedEvent?.Invoke();
 }