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; } UndoCommandManager.Instance.Add(new AddNewNetModuleToAssemblyCommand((AssemblyTreeNode)nodes[0], data.CreateNetModuleOptions())); }
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())); }