Exemplo n.º 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();
     }
 }
Exemplo n.º 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;
         }
     }
 }
Exemplo n.º 3
0
 public static void FormLoad()
 {
     FileHistory.FileHandler = new XMLFileHandler();
     History = FileHistory.Load() ?? new TextFiles();
     HistoryChangedEvent?.Invoke();
 }