Ejemplo n.º 1
0
        public static bool Start(string filename)
        {
            var debugger = DebuggerService.CurrentDebugger;

            if (debugger == null || debugger.IsDebugging)
            {
                return(false);
            }

            if (DebuggerSettings.Instance.AskForArguments)
            {
                bool?result;
                var  debugOpts = SavedDebuggedOptions.ShowDebugExecutableDialogBox(filename, out result);
                if (result == true)
                {
                    DebuggerPlugin.StartExecutable(debugOpts.Executable, debugOpts.WorkingDirectory, debugOpts.Arguments, debugOpts.BreakAtBeginning);
                    return(true);
                }
                return(false);
            }
            else
            {
                DebuggerPlugin.StartExecutable(filename, null, null, DebuggerSettings.Instance.BreakAtBeginning);
                return(true);
            }
        }
Ejemplo n.º 2
0
        public static bool Start()
        {
            if (DebuggerService.CurrentDebugger == null || DebuggerService.CurrentDebugger.IsDebugging)
            {
                return(false);
            }

            if (DebuggerSettings.Instance.AskForArguments)
            {
                bool?result;
                var  debugOpts = SavedDebuggedOptions.ShowDebugExecutableDialogBox(null, out result);
                if (result == true)
                {
                    MainWindow.Instance.OpenFiles(new[] { debugOpts.Executable }, false);
                    DebuggerPlugin.StartExecutable(debugOpts.Executable, debugOpts.WorkingDirectory, debugOpts.Arguments, debugOpts.BreakAtBeginning);
                    return(true);
                }
            }
            else
            {
                OpenFileDialog dialog = new OpenFileDialog()
                {
                    Filter           = ".NET Executable (*.exe) | *.exe",
                    RestoreDirectory = true,
                    DefaultExt       = "exe"
                };
                if (dialog.ShowDialog() == true)
                {
                    MainWindow.Instance.OpenFiles(new[] { dialog.FileName }, false);
                    DebuggerPlugin.StartExecutable(dialog.FileName, null, null, DebuggerSettings.Instance.BreakAtBeginning);
                    return(true);
                }
            }
            return(false);
        }