Пример #1
0
 private void DebuggerInstance_OnContinue(object sender, Debugger.OnContinueEventArgs e)
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         Logger.Log(NLog.LogLevel.Info, "Execution was continued.");
         this.IsPaused  = false;
         this.CallStack = Enumerable.Empty <CallstackItem>();
         LastSF?.RedrawEditor();
     }, System.Windows.Threading.DispatcherPriority.Send);
 }
Пример #2
0
        private void DebuggerInstance_OnHalt(object sender, Debugger.OnHaltEventArgs e)
        {
            App.Current.Dispatcher.Invoke(() =>
            {
                Logger.Log(NLog.LogLevel.Info, "Execution was halted.");
                this.IsPaused      = true;
                this.CurrentLine   = e.Line;
                this.CurrentColumn = e.Col;
                this.CallStack     = this.DebuggerInstance.GetCallstack();

                App.Current.MainWindow.Activate();
                SolutionFile sf = null;
                if (!SolutionFileBase.WalkThrough(Workspace.CurrentWorkspace.CurrentSolution.FilesCollection, (sfb) =>
                {
                    var f = sfb as SolutionFile;
                    if (f != null && f.ArmAPath.Equals(e.DocumentPath, StringComparison.InvariantCultureIgnoreCase))
                    {
                        LastSF = sf = f;
                        return(true);
                    }
                    return(false);
                }))
                {
                    Logger.Log(NLog.LogLevel.Info, string.Format("Could not locate document {0}.", e.DocumentPath));
                    return;
                }
                Workspace.CurrentWorkspace.OpenOrFocusDocument(sf);
                var doc = Workspace.CurrentWorkspace.GetDocumentOfSolutionFileBase(sf) as DataContext.TextEditorDocument;
                sf.RedrawEditor();
                if (doc == null)
                {
                    Logger.Log(NLog.LogLevel.Info, string.Format("Document {0} is no TextEditorDocument?", sf.RelativePath));
                    return;
                }
                //ToDo: Remove when document gets closed
                this.CurrentDocument = doc;
            }, System.Windows.Threading.DispatcherPriority.Send);
        }