コード例 #1
0
 private void exitToolStripMenuItem_Click(object sender, EventArgs e)
 {
     doNotBreak = true;
     ContineExecutionEvent.Set();
     this.Close();
     Environment.Exit(0);
 }
コード例 #2
0
        /// <summary>
        /// F5 Implementation
        /// </summary>
        private void runToolStripMenuItem_Click(object sender, EventArgs e)
        {
            doNotBreak = true;

            if (!debugSessionInProgress)
            {
                LaunchDebugger();
            }
            else
            {
                ContineExecutionEvent.Set();
            }
        }
コード例 #3
0
        private void DoExecutableBlockStartedFinshed(StackFrame[] callStack, bool atStart)
        {
            // Note down the call stack
            _currentCallStack        = callStack;
            _currentCallStackAtStart = new bool?(atStart);

            // Ensure we are not hitting any break points
            BreakPoint hitBP = Array.Find <BreakPoint>(
                _breakPointManager.ActiveBreakPoints,
                bp => (bp.ExecutablePath.Equals(callStack[0].ExecutablePath, StringComparison.OrdinalIgnoreCase) && (bp.Location == callStack[0].StartLocation))
                );

            if (hitBP != null)
            {
                WriteToOutputWindow("DEBUGGER: BreakPoint hit: {0}\r\n", hitBP.ToString());
                doNotBreak = false;
            }

            // If we are not to break, dont react to this event
            if (doNotBreak)
            {
                //UpdateCallStackWindow(new StackFrame[0], true);
                goto CleanupAndExit;
            }

            // Make the UI respond appropriately
            Invoke(
                new MethodInvoker(
                    () =>
            {
                _openFilesManager.LocateExecutionPoint(callStack[0], atStart);
                UpdateCallStackWindow(callStack, atStart);
                propertyViewerUserControlProperties.Update(_currentProject.EvaluatedProperties);
                propertyViewerUserControlItems.Update(_currentProject.EvaluatedItems);
                listViewBreakPoints.Enabled                 = true;
                listViewCallStack.Enabled                   = true;
                propertyViewerUserControlItems.Enabled      = true;
                propertyViewerUserControlProperties.Enabled = true;
            }
                    )
                );

            // Wait on the main window to tell us to go ahead
            ContineExecutionEvent.WaitOne();

CleanupAndExit:
            // Finally do any required cleanups
            Invoke(
                new MethodInvoker(
                    () =>
            {
                _openFilesManager.ClearExecutionPointHighlighting();
                listViewBreakPoints.Enabled                 = false;
                listViewCallStack.Enabled                   = false;
                propertyViewerUserControlItems.Enabled      = false;
                propertyViewerUserControlProperties.Enabled = false;
            }
                    )
                );

            // No call stack when running
            _currentCallStack        = null;
            _currentCallStackAtStart = null;
        }