public void NavigateToLocation(SourceLocation location) { var file = _host.FileService.OpenFile(location.FilePath); var navigator = file.CurrentDocumentContent as ISourceNavigator ?? file.RegisteredDocumentContents.FirstOrDefault(x => x is ISourceNavigator) as ISourceNavigator; if (navigator == null) { var fileHandlers = _host.ExtensionManager.GetFileHandlers(location.FilePath).Where(x => x is ISourceNavigator).ToArray(); if (fileHandlers.Length == 0) throw new ArgumentException(_muiProcessor.GetString("MainForm.Messages.NoEditorAvailable", "file=" + location.FilePath.FullPath)); var handler = _host.FileService.SelectFileHandler(fileHandlers, location.FilePath); handler.OpenFile(file); } else { _host.ControlManager.ShowAndActivate(navigator as LiteDocumentContent); } if (navigator != null) navigator.NavigateToLocation(location); }
public ExceptionDialog(IThread thread) { InitializeComponent(); this.Icon = _icon; _exceptionValue = thread.CurrentException; _sourceLocation = thread.GetCurrentSourceRange(); // no need to hook to UILanguageChanged as this dialog will be closed // before the user gets any chance to update the UI language. var _componentMuiIdentifiers = new Dictionary<object, string>() { {this, "ExceptionDialog.Title"}, {headerLabel, "ExceptionDialog.ExceptionOccured"}, {fileLabel, "ExceptionDialog.File"}, {locationLabel, "ExceptionDialog.Location"}, {messageLabel, "ExceptionDialog.Message"}, {closeButton, "ExceptionDialog.Close"}, {goToFileButton, "ExceptionDialog.GoToFile"}, {detailsButton, "ExceptionDialog.Details"}, }; DebuggerBase.Instance.MuiProcessor.ApplyLanguageOnComponents(_componentMuiIdentifiers); fileTextBox.Text = _sourceLocation.FilePath.FullPath; locationTextBox.Text = DebuggerBase.Instance.MuiProcessor.GetString("ExceptionDialog.LocationFormat", "line=" + _sourceLocation.Line, "column=" + _sourceLocation.Column); messageTextBox.Text = _exceptionValue.ValueAsString(thread); }
public void NavigateToLocation(SourceLocation location) { if (!location.FilePath.FileExists()) { MessageBox.Show(_muiProcessor.GetString("Common.Messages.FileNotFound", new Dictionary<string, string>() { {"file", location.FilePath.FullPath} }), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var file = _host.FileService.OpenFile(location.FilePath); var navigator = file.CurrentDocumentContent as ISourceNavigator ?? file.RegisteredDocumentContents.FirstOrDefault(x => x is ISourceNavigator) as ISourceNavigator; if (navigator == null) { var fileHandlers = _host.ExtensionManager.GetFileHandlers(location.FilePath).Where(x => x is ISourceNavigator).ToArray(); if (fileHandlers.Length == 0) throw new ArgumentException(_muiProcessor.GetString("Common.Messages.NoEditorAvailable", "file=" + location.FilePath.FullPath)); var handler = _host.FileService.SelectFileHandler(fileHandlers, location.FilePath); handler.OpenFile(file); } else { _host.ControlManager.ShowAndActivate(navigator as LiteDocumentContent); } if (navigator != null) navigator.NavigateToLocation(location); }
public void NavigateToLocation(SourceLocation location) { if (_editorControl.TextBox.LinesCount >= location.Line) { _editorControl.TextBox.Selection = new Range(_editorControl.TextBox, location.Column - 1, location.Line - 1, location.Column - 1, location.Line - 1); _editorControl.TextBox.DoCaretVisible(); } }
public Bookmark(SourceLocation location) { if (location == null) throw new ArgumentNullException("location"); _location = location; Image = Properties.Resources.bookmark; }
public bool TryGetFunctionByLocation(SourceLocation location, out SymbolToken token) { token = default(SymbolToken); try { var document = _comReader.GetDocument(location.FilePath.FullPath, default(Guid), default(Guid), default(Guid)); if (document == null) return false; var method = _comReader.GetMethodFromDocumentPosition(document, location.Line, location.Column); if (method == null) return false; token = method.GetToken(); return true; } catch (COMException) { return false; } }
public BreakpointBookmark(SourceLocation location) : base(location) { IsActive = true; Image = Properties.Resources.breakpoint; }
public SourceLocationEventArgs(SourceLocation location) { Location = location; }
public void NavigateToLocation(SourceLocation location) { foreach (var editor in _codeEditors) { if (editor.Key.FilePath.Equals(location.FilePath)) { editor.Value.NavigateToLocation(location); } } }
public BuildError(SourceLocation location, string message, MessageSeverity severity) { Location = location; Message = message; Severity = severity; }