static void Execute(ILSpyTreeNode[] nodes) { if (!CanExecute(nodes)) { return; } var newModule = new ModuleDefUser(); var data = new AssemblyOptionsVM(AssemblyOptions.Create("MyAssembly"), newModule, MainWindow.Instance.CurrentLanguage); data.CanShowClrVersion = true; var win = new AssemblyOptionsDlg(); win.Title = CMD_NAME; win.DataContext = data; win.Owner = MainWindow.Instance; if (win.ShowDialog() != true) { return; } var cmd = new CreateAssemblyCommand(newModule, data.CreateAssemblyOptions()); UndoCommandManager.Instance.Add(cmd); MainWindow.Instance.JumpToReference(cmd.asmNodeCreator.AssemblyTreeNode); }
static void Execute(Lazy <IUndoCommandService> undoCommandService, IAppService appService, DocumentTreeNodeData[] nodes) { if (!CanExecute(nodes)) { return; } var newModule = new ModuleDefUser(); var data = new AssemblyOptionsVM(AssemblyOptions.Create("MyAssembly"), newModule, appService.DecompilerService); data.CanShowClrVersion = true; var win = new AssemblyOptionsDlg(); win.Title = dnSpy_AsmEditor_Resources.CreateAssemblyCommand2; win.DataContext = data; win.Owner = appService.MainWindow; if (win.ShowDialog() != true) { return; } var cmd = new CreateAssemblyCommand(undoCommandService.Value, appService.DocumentTreeView, newModule, data.CreateAssemblyOptions()); 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 newModule = new ModuleDefUser(); var data = new AssemblyOptionsVM(AssemblyOptions.Create("MyAssembly"), newModule, appWindow.LanguageManager); data.CanShowClrVersion = true; var win = new AssemblyOptionsDlg(); win.Title = dnSpy_AsmEditor_Resources.CreateAssemblyCommand2; win.DataContext = data; win.Owner = appWindow.MainWindow; if (win.ShowDialog() != true) { return; } var cmd = new CreateAssemblyCommand(undoCommandManager.Value, appWindow.FileTreeView, newModule, data.CreateAssemblyOptions()); undoCommandManager.Value.Add(cmd); appWindow.FileTabManager.FollowReference(cmd.fileNodeCreator.DnSpyFileNode); }