diff options
author | 2011-01-26 02:22:07 +0000 | |
---|---|---|
committer | 2011-01-26 02:22:07 +0000 | |
commit | d10092583e4f3ee31772300ca097a616ca2713a2 (patch) | |
tree | de5015aa4b934b38e12101873f2a9ca0101832ee /Source/ModelViewer/Main.cs | |
parent | d50a591fabea54378ae073b705869c05ccfc5f61 (diff) |
Right-clicking on a state allows to display the source code for it
Diffstat (limited to 'Source/ModelViewer/Main.cs')
-rw-r--r-- | Source/ModelViewer/Main.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Source/ModelViewer/Main.cs b/Source/ModelViewer/Main.cs index c9b574e8..1df48a29 100644 --- a/Source/ModelViewer/Main.cs +++ b/Source/ModelViewer/Main.cs @@ -621,6 +621,22 @@ namespace Microsoft.Boogie.ModelViewer ReadModels();
LoadModel(modelId);
}
+
+ private SourceView sourceView;
+ private void showSourceToolStripMenuItem_Click(object sender, EventArgs e)
+ {
+ if (stateList.SelectedItems.Count == 0) return;
+ var li = stateList.SelectedItems[0] as ListViewItem;
+ if (li != null) {
+ var r = ((IState)li.Tag).ShowSource();
+ if (r != null) {
+ if (sourceView == null) {
+ sourceView = new SourceView();
+ }
+ sourceView.SetSourceLocation(r);
+ }
+ }
+ }
}
internal class DisplayItem : ListViewItem
|