|
|
|
@ -18,6 +18,7 @@
@@ -18,6 +18,7 @@
|
|
|
|
|
|
|
|
|
|
using System; |
|
|
|
|
using System.Linq; |
|
|
|
|
using System.Windows.Threading; |
|
|
|
|
using ICSharpCode.Decompiler.TypeSystem; |
|
|
|
|
using ICSharpCode.ILSpy.Docking; |
|
|
|
|
using ICSharpCode.ILSpy.Properties; |
|
|
|
@ -42,7 +43,12 @@ namespace ICSharpCode.ILSpy.Commands
@@ -42,7 +43,12 @@ namespace ICSharpCode.ILSpy.Commands
|
|
|
|
|
public void Execute(TextViewContext context) |
|
|
|
|
{ |
|
|
|
|
if (context.SelectedTreeNodes != null) { |
|
|
|
|
var nodes = context.SelectedTreeNodes.OfType<IMemberTreeNode>().Select(FindTreeNode).ToArray(); |
|
|
|
|
ILSpyTreeNode[] nodes; |
|
|
|
|
if (context.TreeView != MainWindow.Instance.treeView) { |
|
|
|
|
nodes = context.SelectedTreeNodes.OfType<IMemberTreeNode>().Select(FindTreeNode).ToArray(); |
|
|
|
|
} else { |
|
|
|
|
nodes = context.SelectedTreeNodes.OfType<ILSpyTreeNode>().ToArray(); |
|
|
|
|
} |
|
|
|
|
DecompileNodes(nodes); |
|
|
|
|
} else if (context.Reference?.Reference is IEntity entity) { |
|
|
|
|
if (MainWindow.Instance.FindTreeNode(entity) is ILSpyTreeNode node) { |
|
|
|
@ -67,6 +73,7 @@ namespace ICSharpCode.ILSpy.Commands
@@ -67,6 +73,7 @@ namespace ICSharpCode.ILSpy.Commands
|
|
|
|
|
DockWorkspace.Instance.Documents.Add(new ViewModels.DecompiledDocumentModel(title, title) { Language = MainWindow.Instance.CurrentLanguage, LanguageVersion = MainWindow.Instance.CurrentLanguageVersion }); |
|
|
|
|
DockWorkspace.Instance.ActiveDocument = DockWorkspace.Instance.Documents.Last(); |
|
|
|
|
MainWindow.Instance.SelectNodes(nodes); |
|
|
|
|
MainWindow.Instance.Dispatcher.BeginInvoke(DispatcherPriority.Background, (Action)MainWindow.Instance.RefreshDecompiledView); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|