Beispiel #1
0
        private void OnEndSession()
        {
            Dispatcher.UIThread.InvokeAsync(() =>
            {
                DebugSessionEnded?.Invoke(this, EventArgs.Empty);

                _shell.CurrentPerspective = Perspective.Editor;

                _lastDocument?.ClearDebugHighlight();
                _lastDocument = null;
            });

            lock (_sessionLock)
            {
                if (_session != null)
                {
                    _session.Exit();
                    _session.TargetUnhandledException -= _session_TargetStopped;
                    _session.TargetStopped            -= _session_TargetStopped;
                    _session.TargetHitBreakpoint      -= _session_TargetStopped;
                    _session.TargetSignaled           -= _session_TargetStopped;
                    _session.TargetInterrupted        -= _session_TargetStopped;
                    _session.TargetExited             -= _session_TargetExited;
                    _session.TargetStarted            -= _session_TargetStarted;
                    _session.TargetReady -= _session_TargetReady;
                    _session.Dispose();
                    _session = null;
                }
            }

            // This will save breakpoints that were moved to be closer to actual sequence points.
            Breakpoints.Save();
        }
        private void SaveBreakpoints()
        {
            if (!_loadingBreakpoints)
            {
                var solution = _shell.CurrentSolution;

                Platform.EnsureSolutionUserDataDirectory(solution);

                var file = System.IO.Path.Combine(Platform.GetUserDataDirectory(solution), "Breakpoints.xml");

                using (var writer = XmlWriter.Create(file))
                {
                    Breakpoints.Save().WriteTo(writer);
                }
            }
        }