public AppendAction ( IAction newAction ) : bool | ||
newAction | IAction | |
return | bool |
public bool AppendAction(IAction newAction)
{
if(CurrentState.PreviousAction == null)
{
CurrentState.NextAction = newAction;
CurrentState.NextNode = new SimpleHistoryNode(newAction, CurrentState);
}
else
{
if(CurrentState.PreviousAction.TryToMerge(newAction))
{
RaiseUndoBufferChanged();
return false;
}
CurrentState.NextAction = newAction;
CurrentState.NextNode = new SimpleHistoryNode(newAction, CurrentState);
}
return true;
}