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); }
/// <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(); }
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)); } }
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); }