static void Execute(Lazy <IUndoCommandManager> undoCommandManager, IAppWindow appWindow, IFileTreeNodeData[] nodes) { if (!AddNetModuleToAssemblyCommand.CanExecute(nodes)) { return; } var asmNode = (IDnSpyFileNode)nodes[0]; if (asmNode is IModuleFileNode) { asmNode = (IAssemblyFileNode)asmNode.TreeNode.Parent.Data; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(asmNode.DnSpyFile.ModuleDef); win.DataContext = data; win.Owner = appWindow.MainWindow; if (win.ShowDialog() != true) { return; } var options = data.CreateNetModuleOptions(); var newModule = ModuleUtils.CreateNetModule(options.Name, options.Mvid, options.ClrVersion); var newFile = DnSpyDotNetFile.CreateModule(DnSpyFileInfo.CreateFile(string.Empty), newModule, appWindow.FileTreeView.FileManager.Settings.LoadPDBFiles); var newModNode = asmNode.Context.FileTreeView.CreateModule(newFile); var cmd = new AddNewNetModuleToAssemblyCommand(undoCommandManager.Value, (IDnSpyFileNode)nodes[0], newModNode); undoCommandManager.Value.Add(cmd); appWindow.FileTabManager.FollowReference(cmd.modNode); }
static void Execute(Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!AddNetModuleToAssemblyCommand.CanExecute(nodes)) { return; } var asmNode = (DsDocumentNode)nodes[0]; if (asmNode is ModuleDocumentNode) { asmNode = (AssemblyDocumentNode)asmNode.TreeNode.Parent.Data; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(asmNode.Document.ModuleDef); win.DataContext = data; win.Owner = appService.MainWindow; if (win.ShowDialog() != true) { return; } var options = data.CreateNetModuleOptions(); var newModule = ModuleUtils.CreateNetModule(options.Name, options.Mvid, options.ClrVersion); var newFile = DsDotNetDocument.CreateModule(DsDocumentInfo.CreateDocument(string.Empty), newModule, true); var newModNode = asmNode.Context.DocumentTreeView.CreateModule(newFile); var cmd = new AddNewNetModuleToAssemblyCommand(undoCommandService.Value, (DsDocumentNode)nodes[0], newModNode); undoCommandService.Value.Add(cmd); appService.DocumentTabService.FollowReference(cmd.modNode); }
static void Execute(ILSpyTreeNode[] nodes) { if (!AddNetModuleToAssemblyCommand.CanExecute(nodes)) { return; } var asmNode = (AssemblyTreeNode)nodes[0]; if (asmNode.Parent is AssemblyTreeNode) { asmNode = (AssemblyTreeNode)asmNode.Parent; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(asmNode.LoadedAssembly.ModuleDefinition); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) { return; } var cmd = new AddNewNetModuleToAssemblyCommand((AssemblyTreeNode)nodes[0], data.CreateNetModuleOptions()); UndoCommandManager.Instance.Add(cmd); MainWindow.Instance.JumpToReference(cmd.modNode); }
static void Execute(ILSpyTreeNode[] nodes) { if (!CanExecute(nodes)) return; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) return; var cmd = new CreateNetModuleCommand(data.CreateNetModuleOptions()); UndoCommandManager.Instance.Add(cmd); MainWindow.Instance.JumpToReference(cmd.asmNodeCreator.AssemblyTreeNode); }
static void Execute(ILSpyTreeNode[] nodes) { if (!CanExecute(nodes)) { return; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) { return; } UndoCommandManager.Instance.Add(new CreateNetModuleCommand(data.CreateNetModuleOptions())); }
static void Execute(Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(nodes)) { return; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = appService.MainWindow; if (win.ShowDialog() != true) { return; } var cmd = new CreateNetModuleCommand(undoCommandService, appService.DocumentTreeView, data.CreateNetModuleOptions()); undoCommandService.Value.Add(cmd); appService.DocumentTabService.FollowReference(cmd.fileNodeCreator.DocumentNode); }
static void Execute(Lazy <IUndoCommandManager> undoCommandManager, IAppWindow appWindow, IFileTreeNodeData[] nodes) { if (!CanExecute(nodes)) { return; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = appWindow.MainWindow; if (win.ShowDialog() != true) { return; } var cmd = new CreateNetModuleCommand(undoCommandManager, appWindow.FileTreeView, data.CreateNetModuleOptions()); undoCommandManager.Value.Add(cmd); appWindow.FileTabManager.FollowReference(cmd.fileNodeCreator.DnSpyFileNode); }
static void Execute(ILSpyTreeNode[] nodes) { if (!CanExecute(nodes)) { return; } var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) { return; } var cmd = new CreateNetModuleCommand(data.CreateNetModuleOptions()); UndoCommandManager.Instance.Add(cmd); MainWindow.Instance.JumpToReference(cmd.asmNodeCreator.AssemblyTreeNode); }
static void Execute(ILSpyTreeNode[] nodes) { if (!AddNetModuleToAssemblyCommand.CanExecute(nodes)) return; var asmNode = (AssemblyTreeNode)nodes[0]; if (asmNode.Parent is AssemblyTreeNode) asmNode = (AssemblyTreeNode)asmNode.Parent; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(asmNode.LoadedAssembly.ModuleDefinition); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) return; var cmd = new AddNewNetModuleToAssemblyCommand((AssemblyTreeNode)nodes[0], data.CreateNetModuleOptions()); UndoCommandManager.Instance.Add(cmd); MainWindow.Instance.JumpToReference(cmd.modNode); }
static void Execute(Lazy<IUndoCommandManager> undoCommandManager, IAppWindow appWindow, IFileTreeNodeData[] nodes) { if (!CanExecute(nodes)) return; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = appWindow.MainWindow; if (win.ShowDialog() != true) return; var cmd = new CreateNetModuleCommand(undoCommandManager, appWindow.FileTreeView, data.CreateNetModuleOptions()); undoCommandManager.Value.Add(cmd); appWindow.FileTabManager.FollowReference(cmd.fileNodeCreator.DnSpyFileNode); }
static void Execute(Lazy<IUndoCommandManager> undoCommandManager, IAppWindow appWindow, IFileTreeNodeData[] nodes) { if (!AddNetModuleToAssemblyCommand.CanExecute(nodes)) return; var asmNode = (IDnSpyFileNode)nodes[0]; if (asmNode is IModuleFileNode) asmNode = (IAssemblyFileNode)asmNode.TreeNode.Parent.Data; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(asmNode.DnSpyFile.ModuleDef); win.DataContext = data; win.Owner = appWindow.MainWindow; if (win.ShowDialog() != true) return; var options = data.CreateNetModuleOptions(); var newModule = ModuleUtils.CreateNetModule(options.Name, options.Mvid, options.ClrVersion); var newFile = DnSpyDotNetFile.CreateModule(DnSpyFileInfo.CreateFile(string.Empty), newModule, appWindow.FileTreeView.FileManager.Settings.LoadPDBFiles); var newModNode = asmNode.Context.FileTreeView.CreateModule(newFile); var cmd = new AddNewNetModuleToAssemblyCommand(undoCommandManager.Value, (IDnSpyFileNode)nodes[0], newModNode); undoCommandManager.Value.Add(cmd); appWindow.FileTabManager.FollowReference(cmd.modNode); }
static void Execute(ILSpyTreeNode[] nodes) { if (!CanExecute(nodes)) return; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) return; UndoCommandManager.Instance.Add(new CreateNetModuleCommand(data.CreateNetModuleOptions())); }
static void Execute(Lazy<IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(nodes)) return; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(); win.DataContext = data; win.Owner = appService.MainWindow; if (win.ShowDialog() != true) return; var cmd = new CreateNetModuleCommand(undoCommandService, appService.DocumentTreeView, data.CreateNetModuleOptions()); undoCommandService.Value.Add(cmd); appService.DocumentTabService.FollowReference(cmd.fileNodeCreator.DocumentNode); }
static void Execute(Lazy<IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!AddNetModuleToAssemblyCommand.CanExecute(nodes)) return; var asmNode = (DsDocumentNode)nodes[0]; if (asmNode is ModuleDocumentNode) asmNode = (AssemblyDocumentNode)asmNode.TreeNode.Parent.Data; var win = new NetModuleOptionsDlg(); var data = new NetModuleOptionsVM(asmNode.Document.ModuleDef); win.DataContext = data; win.Owner = appService.MainWindow; if (win.ShowDialog() != true) return; var options = data.CreateNetModuleOptions(); var newModule = ModuleUtils.CreateNetModule(options.Name, options.Mvid, options.ClrVersion); var newFile = DsDotNetDocument.CreateModule(DsDocumentInfo.CreateDocument(string.Empty), newModule, true); var newModNode = asmNode.Context.DocumentTreeView.CreateModule(newFile); var cmd = new AddNewNetModuleToAssemblyCommand(undoCommandService.Value, (DsDocumentNode)nodes[0], newModNode); undoCommandService.Value.Add(cmd); appService.DocumentTabService.FollowReference(cmd.modNode); }