/// <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(); } }
public static void RemoveFromHistory(TextFile file) { foreach (TextFile item in History.FilesList) { if (file.Path == item.Path) { History.FilesList.Remove(item); HistoryChangedEvent?.Invoke(); return; } } }
public static void FormLoad() { FileHistory.FileHandler = new XMLFileHandler(); History = FileHistory.Load() ?? new TextFiles(); HistoryChangedEvent?.Invoke(); }