예제 #1
0
        private void redo()
        {
            if (!_history.CanGoForward)
            {
                return;
            }

            _history.Forward();
            _converter.ApplyJsonChanges(_test, _history.Current);
            enableUndoRedo();
            publish(null);
        }
예제 #2
0
        public void record_four_versions_and_go_backward_and_forward()
        {
            history.Record("a");
            history.Record("b");
            history.Record("c");
            history.Record("d");

            history.Revert();
            history.Current.ShouldEqual("c");
            history.CanGoBack.ShouldBeTrue();
            history.CanGoForward.ShouldBeTrue();

            history.Forward();
            history.Current.ShouldEqual("d");
            history.CanGoBack.ShouldBeTrue();
            history.CanGoForward.ShouldBeFalse();
        }