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.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 ( _
view As IVsTextView _
) As Source
public Source GetSource(
IVsTextView view
)
Parameters
- view
Type: Microsoft.VisualStudio.TextManager.Interop.IVsTextView
[in] An IVsTextView object that displays the source file for which to get 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 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
- 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.