From 9950790ab11a7a79d2c60186baf849acf82655f5 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Thu, 2 Sep 2010 22:33:55 +0200 Subject: [PATCH] removed file load code duplication; replaced by ParserService.GetParseableFileContent --- .../Src/PropertyRefactoringMenuBuilder.cs | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/AddIns/Misc/SharpRefactoring/Project/Src/PropertyRefactoringMenuBuilder.cs b/src/AddIns/Misc/SharpRefactoring/Project/Src/PropertyRefactoringMenuBuilder.cs index a903ee9725..a870ffcd0e 100644 --- a/src/AddIns/Misc/SharpRefactoring/Project/Src/PropertyRefactoringMenuBuilder.cs +++ b/src/AddIns/Misc/SharpRefactoring/Project/Src/PropertyRefactoringMenuBuilder.cs @@ -75,21 +75,7 @@ namespace SharpRefactoring if (fileName == null) return false; - IDocument document; - 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; - } - + IDocument document = DocumentUtilitites.LoadDocumentFromBuffer(ParserService.GetParseableFileContent(fileName)); bool isAutomatic = false; if (property.CanGet) {