Exemple #1
0
        private List <string> GetLines(HistoryEvent historyEvent, HistoryChangedAction changeType)
        {
            List <string> lines = new List <string>();

            switch (changeType)
            {
            case HistoryChangedAction.Add:
                GetLines(historyEvent, lines);
                break;

            case HistoryChangedAction.DeleteBookmark:
                lines.Add(DeleteBookmarkCommand(historyEvent.Id));
                break;

            case HistoryChangedAction.DeleteBranch:
                lines.Add(DeleteBranchCommand(historyEvent.Id));
                break;

            case HistoryChangedAction.SetCurrent:
                lines.Add(CurrentCommand(historyEvent.Id));
                break;

            default:
                throw new ArgumentException("Unknown history action type!", nameof(changeType));
            }

            return(lines);
        }
Exemple #2
0
        private void HistoryEventHappened(HistoryEvent historyEvent, HistoryChangedAction changeAction)
        {
            List <string> lines = GetLines(historyEvent, changeAction);

            foreach (string line in lines)
            {
                _textFile.WriteLine(line);
            }
        }
Exemple #3
0
 private void Notify(HistoryEvent historyEvent, HistoryChangedAction action)
 {
     Auditors?.Invoke(historyEvent, action);
 }