Browse Source

removed file load code duplication; replaced by ParserService.GetParseableFileContent

pull/1/head
Siegfried Pammer 15 years ago
parent
commit
9950790ab1
  1. 16
      src/AddIns/Misc/SharpRefactoring/Project/Src/PropertyRefactoringMenuBuilder.cs

16
src/AddIns/Misc/SharpRefactoring/Project/Src/PropertyRefactoringMenuBuilder.cs

@ -75,21 +75,7 @@ namespace SharpRefactoring
if (fileName == null) if (fileName == null)
return false; return false;
IDocument document; IDocument document = DocumentUtilitites.LoadDocumentFromBuffer(ParserService.GetParseableFileContent(fileName));
ITextEditorProvider provider = FileService.GetOpenFile(fileName) as ITextEditorProvider;
if (provider == null) {
if (!File.Exists(fileName))
return false;
try {
document = DocumentUtilitites.LoadDocumentFromBuffer(new StringTextBuffer(File.ReadAllText(fileName)));
} catch (IOException) {
return false;
}
} else {
document = provider.TextEditor.Document;
}
bool isAutomatic = false; bool isAutomatic = false;
if (property.CanGet) { if (property.CanGet) {

Loading…
Cancel
Save