src/Misc/EFTools/EntityDesign/VisualStudio/VsUtils.cs
// <summary>
//     Gets the text from DocData if it's available, otherwise retreives it from disk.
// </summary>
Gets the text from DocData if it's available, otherwise retreives it from disk.
Gets the text from DocData if it ' s available otherwise retreives it from disk .
internal static string GetFileContentsFromBufferOrDisk(string filePath)
        {
            var fileText = string.Empty;
            var docData = VSHelpers.GetDocData(Services.ServiceProvider, filePath);
            var textLines = docData as IVsTextLines;
            if (textLines != null)
            {
                fileText = VSHelpers.GetTextFromVsTextLines(textLines);
            }
            else
            {
                fileText = File.ReadAllText(filePath);
            }
            return fileText;
        }
internal static string GetFileContentsFromBufferOrDisk ( string filePath ) { var fileText = string . Empty ; var docData = VSHelpers . GetDocData ( Services . ServiceProvider , filePath ) ; var textLines = docData as IVsTextLines ; if ( textLines != null ) { fileText = VSHelpers . GetTextFromVsTextLines ( textLines ) ; } else { fileText = File . ReadAllText ( filePath ) ; } return fileText ; }
Gets the text from DocData if it's available, otherwise retreives it from disk.
Gets the text from DocData if it ' s available otherwise retreives it from disk .
// attempt to construct the text from the doc data if it is available // get the text from the VS buffer and construct an XML DOM object from it
filePath
string