public void Execute(TextViewContext context)
        {
            if (context.SelectedTreeNodes == null)
            {
                return;
            }
            if (!CurrentDebugger.IsDebugging)
            {
                AssemblyTreeNode n = context.SelectedTreeNodes[0] as AssemblyTreeNode;

                if (DebuggerSettings.Instance.AskForArguments)
                {
                    var window = new ExecuteProcessWindow {
                        Owner = MainWindow.Instance,
                        SelectedExecutable = n.LoadedAssembly.FileName
                    };
                    if (window.ShowDialog() == true)
                    {
                        string fileName = window.SelectedExecutable;

                        // execute the process
                        this.StartExecutable(fileName, window.WorkingDirectory, window.Arguments);
                    }
                }
                else
                {
                    this.StartExecutable(n.LoadedAssembly.FileName, null, null);
                }
            }
        }
Example #2
0
        public void Execute(SharpTreeNode[] selectedNodes)
        {
            if (!CurrentDebugger.IsDebugging)
            {
                AssemblyTreeNode n = selectedNodes[0] as AssemblyTreeNode;

                var      settings        = ILSpySettings.Load();
                XElement e               = settings["DebuggerSettings"];
                var      askForArguments = (bool?)e.Attribute("askForArguments");
                if (askForArguments.HasValue && askForArguments.Value)
                {
                    var window = new ExecuteProcessWindow {
                        Owner = MainWindow.Instance,
                        SelectedExecutable = n.LoadedAssembly.FileName
                    };
                    if (window.ShowDialog() == true)
                    {
                        string fileName = window.SelectedExecutable;

                        // execute the process
                        this.StartExecutable(fileName, window.WorkingDirectory, window.Arguments);
                    }
                }
                else
                {
                    this.StartExecutable(n.LoadedAssembly.FileName, null, null);
                }
            }
        }
        public override void Run()
        {
            if (DebuggingOptions.Instance.AskForArguments)
            {
                var window = new ExecuteProcessWindow {
                    Owner = SD.Workbench.MainWindow
                };
                if (window.ShowDialog() == true)
                {
                    string fileName = window.SelectedExecutable;

                    // execute the process
                    StartExecutable(fileName, window.WorkingDirectory, window.Arguments);
                }
            }
            else
            {
                OpenFileDialog dialog = new OpenFileDialog()
                {
                    Filter           = ".NET executable|*.exe",
                    RestoreDirectory = true,
                    DefaultExt       = "exe"
                };
                if (dialog.ShowDialog() == true)
                {
                    string fileName = dialog.FileName;
                    // execute the process
                    StartExecutable(fileName);
                }
            }
        }
Example #4
0
        public override void Execute(object parameter)
        {
            if (!CurrentDebugger.IsDebugging)
            {
                var      settings        = ILSpySettings.Load();
                XElement e               = settings["DebuggerSettings"];
                var      askForArguments = (bool?)e.Attribute("askForArguments");
                if (askForArguments.HasValue && askForArguments.Value)
                {
                    var window = new ExecuteProcessWindow {
                        Owner = MainWindow.Instance
                    };
                    if (window.ShowDialog() == true)
                    {
                        string fileName = window.SelectedExecutable;

                        // add it to references
                        MainWindow.Instance.OpenFiles(new [] { fileName }, false);

                        // execute the process
                        this.StartExecutable(fileName, window.WorkingDirectory, window.Arguments);
                    }
                }
                else
                {
                    OpenFileDialog dialog = new OpenFileDialog()
                    {
                        Filter           = ".NET Executable (*.exe) | *.exe",
                        RestoreDirectory = true,
                        DefaultExt       = "exe"
                    };
                    if (dialog.ShowDialog() == true)
                    {
                        string fileName = dialog.FileName;

                        // add it to references
                        MainWindow.Instance.OpenFiles(new [] { fileName }, false);

                        // execute the process
                        this.StartExecutable(fileName, null, null);
                    }
                }
            }
        }