Browse Source

Add ViewState handling and key navigation for DebugSteps

pull/728/merge
Siegfried Pammer 9 years ago
parent
commit
0366ba18e4
  1. 2
      ILSpy/DebugSteps.xaml
  2. 16
      ILSpy/DebugSteps.xaml.cs

2
ILSpy/DebugSteps.xaml

@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
<TreeView Name="tree" MouseDoubleClick="ShowStateAfter_Click">
<TreeView Name="tree" MouseDoubleClick="ShowStateAfter_Click" KeyDown="tree_KeyDown">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<TextBlock Text="{Binding Description}" />

16
ILSpy/DebugSteps.xaml.cs

@ -100,7 +100,21 @@ namespace ICSharpCode.ILSpy @@ -100,7 +100,21 @@ namespace ICSharpCode.ILSpy
void DecompileAsync(int step, bool isDebug = false)
{
var window = MainWindow.Instance;
window.TextView.DecompileAsync(window.CurrentLanguage, window.SelectedNodes, new DecompilationOptions() { StepLimit = step, IsDebug = isDebug });
var state = window.TextView.GetState();
window.TextView.DecompileAsync(window.CurrentLanguage, window.SelectedNodes,
new DecompilationOptions() {
StepLimit = step,
IsDebug = isDebug,
TextViewState = state
});
}
private void tree_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Enter || e.Key == Key.Return) {
ShowStateAfter_Click(sender, e);
e.Handled = true;
}
}
}
}

Loading…
Cancel
Save