Compartilhar via


LanguageService.GetSource Method (IVsTextView)

Returns an existing Source object that contains the source file shown in the specified text view.

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.12.0 (in Microsoft.VisualStudio.Package.LanguageService.12.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)

Syntax

'Declaration
Public Function GetSource ( _
    view As IVsTextView _
) As Source
public Source GetSource(
    IVsTextView view
)
public:
Source^ GetSource(
    IVsTextView^ view
)
member GetSource : 
        view:IVsTextView -> Source
public function GetSource(
    view : IVsTextView
) : 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 controls the set of source lines shown in the specified view).

Remarks

The IVsTextLines object is obtained from the IVsTextView with a call to IVsTextView.GetBuffer; it is that IVsTextLines object that is used to search for a Source object in the internal list of Source objects.

.NET Framework Security

See Also

Reference

LanguageService Class

GetSource Overload

Microsoft.VisualStudio.Package Namespace