Source.GetText Method
Gets all of the text of the source file.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Syntax
'Declaración
Public Function GetText As String
public string GetText()
Return Value
Type: System.String
The entire source file.
Remarks
Use this method to access the entire source file as a single block of text.
This method calls the GetLastLineIndex method on the IVsTextLines object passed to the Source class constructor, and then returns the result of calling GetText(Int32, Int32, Int32, Int32) with the start and ending location of the source file. This method throws an exception if GetLastLineIndex returns an error.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.