Exemple #1
0
 public void Do(IDocumentAction action)
 {
     if (subtitle == null)
     {
         throw new InvalidOperationException($"{nameof(Subtitle)} is null");
     }
     action.Do(subtitle);
     while (actionList.First.Next != currentAction)
     {
         actionList.Remove(actionList.First.Next);
     }
     actionList.AddAfter(actionList.First, action);
     currentAction = actionList.First.Next;
     modified();
 }
Exemple #2
0
 public bool TryDo(IDocumentAction action)
 {
     if (subtitle == null)
     {
         return(false);
     }
     try
     {
         action.Do(subtitle);
     }
     catch (Exception)
     {
         return(false);
     }
     while (actionList.First.Next != currentAction)
     {
         actionList.Remove(actionList.First.Next);
     }
     actionList.AddAfter(actionList.First, action);
     currentAction = actionList.First.Next;
     modified();
     return(true);
 }