LanguageService.GetSource Method (String)
Returns an existing Source object given a file name.
Namespace: Microsoft.VisualStudio.Package
Assemblies: Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
Syntax
'宣告
Public Function GetSource ( _
fname As String _
) As Source
public Source GetSource(
string fname
)
Parameters
- fname
Type: System.String
[in] The file name for which to find the Source object.
Return Value
Type: Microsoft.VisualStudio.Package.Source
If successful, returns a Source object; otherwise, returns a null value (there is no Source object in this language service that represents the specified file name).
Remarks
Each Source object remembers the file name that it represents. The internal list of Source objects is searched for a matching name (which is a case-insensitive comparison).
.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.