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