Exemple #1
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);
				}
			}
		}
Exemple #2
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);
					}
				}
			}
		}
Exemple #3
0
        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);
                }
            }
        }