|
|
@ -318,7 +318,9 @@ namespace ICSharpCode.CodeCoverage |
|
|
|
void OpenFile(string fileName, int line, int column) |
|
|
|
void OpenFile(string fileName, int line, int column) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (fileName != textEditorFileName) { |
|
|
|
if (fileName != textEditorFileName) { |
|
|
|
textEditor.Load(fileName); |
|
|
|
if (!TryLoadFileIntoTextEditor(fileName)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
textEditor.SyntaxHighlighting = GetSyntaxHighlighting(fileName); |
|
|
|
textEditor.SyntaxHighlighting = GetSyntaxHighlighting(fileName); |
|
|
|
} |
|
|
|
} |
|
|
|
textEditor.ScrollToEnd(); |
|
|
|
textEditor.ScrollToEnd(); |
|
|
@ -327,6 +329,17 @@ namespace ICSharpCode.CodeCoverage |
|
|
|
CodeCoverageService.ShowCodeCoverage(new AvalonEditTextEditorAdapter(textEditor), fileName); |
|
|
|
CodeCoverageService.ShowCodeCoverage(new AvalonEditTextEditorAdapter(textEditor), fileName); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TryLoadFileIntoTextEditor(string fileName) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (!File.Exists(fileName)) { |
|
|
|
|
|
|
|
textEditor.Text = String.Format("File does not exist '{0}'.", fileName); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
textEditor.Load(fileName); |
|
|
|
|
|
|
|
return true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
IHighlightingDefinition GetSyntaxHighlighting(string fileName) |
|
|
|
IHighlightingDefinition GetSyntaxHighlighting(string fileName) |
|
|
|
{ |
|
|
|
{ |
|
|
|
return HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(fileName)); |
|
|
|
return HighlightingManager.Instance.GetDefinitionByExtension(Path.GetExtension(fileName)); |
|
|
|