src/Misc/EFTools/DesignXmlCore/Common/RdtManager.cs
/// <summary>
///     Get string content of a file.
/// </summary>
/// <remarks>
///     This method created for refactoring usage, refactoring will work on all kinds of
///     docdata, not only SqlEditorDocData.  If change this method, please get let LiangZ
///     know.
/// </remarks>
/// <param name="fullPathFileName">File name with full path.</param>
/// <returns>Content of that file in string format.</returns>
Get string content of a file.
Get string content of a file .
public string ReadFromFile(string fullPathFileName)
        {
            string content;
            VsShell.IVsInvisibleEditor invisibleEditor = null;
            VsTextMgr.IVsTextLines textLines;
            try
            {
                if (IsFileInRdt(fullPathFileName))
                {
                    textLines = GetTextLines(fullPathFileName);
                }
                else
                {
                    if (!TryGetTextLinesAndInvisibleEditor(fullPathFileName, out invisibleEditor, out textLines))
                    {
                        textLines = null;
                    }
                }
                content = GetAllTextFromTextLines(textLines);
            }
            finally
            {
                if (invisibleEditor != null)
                {
                    Marshal.ReleaseComObject(invisibleEditor);
                }
            }
            return content;
        }
public string ReadFromFile ( string fullPathFileName ) { string content ; VsShell . IVsInvisibleEditor invisibleEditor = null ; VsTextMgr . IVsTextLines textLines ; try { if ( IsFileInRdt ( fullPathFileName ) ) { textLines = GetTextLines ( fullPathFileName ) ; } else { if ( ! TryGetTextLinesAndInvisibleEditor ( fullPathFileName , out invisibleEditor , out textLines ) ) { textLines = null ; } } content = GetAllTextFromTextLines ( textLines ) ; } finally { if ( invisibleEditor != null ) { Marshal . ReleaseComObject ( invisibleEditor ) ; } } return content ; }
Get string content of a file.
Get string content of a file .
// File is in RDT // File is not in RDT, open it in invisble editor. // Failed to get text lines or invisible editor. // Close invisible editor from RDT
Content of that file in string format.
Content of that file in string format .
fullPathFileName
string
File name with full path.
File name with full path .
remarks
This method created for refactoring usage, refactoring will work on all kinds of
docdata, not only SqlEditorDocData.  If change this method, please get let LiangZ
know.
This method created for refactoring usage refactoring will work on all kinds of docdata not only SqlEditorDocData . If change this method please get let LiangZ know .