Пример #1
0
        public void Extend_after_going_back()
        {
            var sut = new NavigationHistory();

            sut.Extend("a");
            sut.Extend("b");
            sut.Extend("c");

            string item;

            sut.GoBack(out item); // b

            sut.Extend("x");
            sut.Extend("y");

            Assert.IsTrue(sut.GoBack(out item));
            Assert.AreEqual("x", item);
            Assert.IsTrue(sut.GoBack(out item));
            Assert.AreEqual("b", item);

            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("x", item);
            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("y", item);
        }
        public void Go_forward_from_beginning()
        {
            var sut = new NavigationHistory();
            sut.Extend("a");
            sut.Extend("b");
            sut.Extend("c");

            string item;
            sut.GoBack(out item);
            sut.GoBack(out item);

            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("b", item);
            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("c", item);
        }
Пример #3
0
        /// <summary>
        /// Moves forward to the controller in the navigation history
        /// </summary>
        public void GoForward()
        {
            Controller currentController = history.GetCurrent();

            history.GoForward();
            history.GetCurrent().Activate();
            currentController.Deactivate();
        }
Пример #4
0
        public void Navigate_forward(string[] flowSource, Action <Tuple <string[], string> > continueWith)
        {
            string flowname;

            if (_history.GoForward(out flowname))
            {
                continueWith(new Tuple <string[], string>(flowSource, flowname));
            }
        }
Пример #5
0
        public void Go_forward_from_beginning()
        {
            var sut = new NavigationHistory();

            sut.Extend("a");
            sut.Extend("b");
            sut.Extend("c");

            string item;

            sut.GoBack(out item);
            sut.GoBack(out item);

            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("b", item);
            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("c", item);
        }
        public void Extend_after_going_back()
        {
            var sut = new NavigationHistory();
            sut.Extend("a");
            sut.Extend("b");
            sut.Extend("c");

            string item;
            sut.GoBack(out item); // b

            sut.Extend("x");
            sut.Extend("y");

            Assert.IsTrue(sut.GoBack(out item));
            Assert.AreEqual("x", item);
            Assert.IsTrue(sut.GoBack(out item));
            Assert.AreEqual("b", item);

            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("x", item);
            Assert.IsTrue(sut.GoForward(out item));
            Assert.AreEqual("y", item);
        }
        void NavigateHistory(bool forward)
        {
            var dtState = decompilerTextView.GetState();

            if (dtState != null)
            {
                history.UpdateCurrent(new NavigationState(dtState));
            }
            var newState = forward ? history.GoForward() : history.GoBack();

            ignoreDecompilationRequests = true;
            treeView.SelectedItems.Clear();
            foreach (var node in newState.TreeNodes)
            {
                treeView.SelectedItems.Add(node);
            }
            if (newState.TreeNodes.Any())
            {
                treeView.FocusNode(newState.TreeNodes.First());
            }
            ignoreDecompilationRequests = false;
            DecompileSelectedNodes(newState.ViewState, false);
        }