Browse Source
Adds a uniqueness semantic to the navigation history, by removing the previous state (by the selected nodes) from the prior history.
pull/132/head
Adds a uniqueness semantic to the navigation history, by removing the previous state (by the selected nodes) from the prior history.
pull/132/head

4 changed files with 41 additions and 13 deletions
-
3ILSpy/ILSpy.csproj
-
19ILSpy/MainWindow.xaml.cs
-
4ILSpy/NavigationHistory.cs
-
28ILSpy/NavigationState.cs
@ -0,0 +1,28 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using ICSharpCode.ILSpy.TextView; |
|||
using ICSharpCode.TreeView; |
|||
namespace ICSharpCode.ILSpy |
|||
{ |
|||
public class NavigationState : IEquatable<NavigationState> |
|||
{ |
|||
private HashSet<SharpTreeNode> treeNodes; |
|||
|
|||
public IEnumerable<SharpTreeNode> TreeNodes { get { return treeNodes; } } |
|||
public DecompilerTextViewState ViewState { get; private set; } |
|||
|
|||
public NavigationState(IEnumerable<SharpTreeNode> treeNodes, DecompilerTextViewState viewState) |
|||
{ |
|||
this.treeNodes = new HashSet<SharpTreeNode>(treeNodes); |
|||
ViewState = viewState; |
|||
} |
|||
|
|||
public bool Equals(NavigationState other) |
|||
{ |
|||
// TODO: should this care about the view state as well?
|
|||
return this.treeNodes.SetEquals(other.treeNodes); |
|||
} |
|||
} |
|||
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue