Пример #1
0
        /// <summary>
        /// Occurs when the button is clicked.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">A <see cref="RoutedEventArgs"/> that contains the event data.</param>
        private void OnStopDebuggingButtonClick(object sender, RoutedEventArgs e)
        {
            // Flag as not debugging
            currentStatementSnapshotOffset = DebuggingHelper.SetCurrentStatement(editor.Document, TextSnapshotOffset.Deleted);
            stopDebuggingButton.IsEnabled  = false;

            // Focus the editor
            editor.Focus();
        }
Пример #2
0
        /// <summary>
        /// Occurs when the button is clicked.
        /// </summary>
        /// <param name="sender">The sender of the event.</param>
        /// <param name="e">A <see cref="RoutedEventArgs"/> that contains the event data.</param>
        private void OnStartDebuggingButtonClick(object sender, RoutedEventArgs e)
        {
            // If starting debugging from a stopped state, begin looking at the document start
            if (currentStatementSnapshotOffset.IsDeleted)
            {
                currentStatementSnapshotOffset = new TextSnapshotOffset(editor.ActiveView.CurrentSnapshot, 0);
            }

            // Flag as debugging
            currentStatementSnapshotOffset = DebuggingHelper.SetCurrentStatement(editor.Document, currentStatementSnapshotOffset);
            stopDebuggingButton.IsEnabled  = !currentStatementSnapshotOffset.IsDeleted;

            // Focus the editor
            editor.Focus();
        }