コード例 #1
0
 public void Clear()
 {
     Past.Clear();
     Future.Clear();
     _history.Clear();
     _future.Clear();
     CanUndo = false;
     CanRedo = false;
 }
コード例 #2
0
        public void AddHandler(HistoryHandler handler)
        {
            handler.ActionPush += (sender, action) => {
                if (!_acceptNew)
                {
                    return;
                }

                _history.Push(action);
                Past.Add(action);
                _future.Clear();
                Future.Clear();
                CanRedo = false;
                CanUndo = true;
            };
        }