Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }