private void Cmd_EntryOnDoubleClick(object param) { var li = param as TextEditorUtil.LinterInfo; if (li == null) { System.Diagnostics.Debugger.Break(); return; } Workspace.CurrentWorkspace.OpenOrFocusDocument(li.FilePath); SolutionFileBase.WalkThrough(Workspace.CurrentWorkspace.CurrentSolution.FilesCollection, (sfb) => { var f = sfb as SolutionFile; if (f != null && f.ArmAPath.Contains(li.FileName)) { var doc = Workspace.CurrentWorkspace.GetDocumentOfSolutionFileBase(f) as TextEditorDocument; if (doc != null && doc.Editor != null) { doc.Editor.TextArea.Caret.Line = li.Line; doc.Editor.TextArea.Caret.Column = li.LineOffset; doc.Editor.ScrollToLine(li.Line); doc.Editor.TextArea.Caret.Show(); } return(true); } return(false); }); }
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); }