Share via


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

'Declaration
Public Function GetSource ( _
    fname As String _
) As Source
public Source GetSource(
    string fname
)
public:
Source^ GetSource(
    String^ fname
)
member GetSource : 
        fname:string -> Source
public function GetSource(
    fname : String
) : Source

Parameters

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

See Also

Reference

LanguageService Class

GetSource Overload

Microsoft.VisualStudio.Package Namespace