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); }
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(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); }
public override void Execute(AsmEditorContext context) => CreateAssemblyCommand.Execute(undoCommandService, appService, context.Nodes);
public override bool IsVisible(AsmEditorContext context) => CreateAssemblyCommand.CanExecute(context.Nodes);
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); }
protected override void ExecuteInternal(ILSpyTreeNode[] nodes) { CreateAssemblyCommand.Execute(nodes); }
protected override bool CanExecuteInternal(ILSpyTreeNode[] nodes) { return(CreateAssemblyCommand.CanExecute(nodes)); }
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); }
public override void Execute(AsmEditorContext context) { CreateAssemblyCommand.Execute(undoCommandManager, appWindow, context.Nodes); }
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); }