ExpansionFunction.GetSelection 方法

获取选定文本的范围在当前视图的。

命名空间:  Microsoft.VisualStudio.Package
程序集:   Microsoft.VisualStudio.Package.LanguageService.9.0(在 Microsoft.VisualStudio.Package.LanguageService.9.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService.11.0(在 Microsoft.VisualStudio.Package.LanguageService.11.0.dll 中)
  Microsoft.VisualStudio.Package.LanguageService(在 Microsoft.VisualStudio.Package.LanguageService.dll 中)
  Microsoft.VisualStudio.Package.LanguageService.10.0(在 Microsoft.VisualStudio.Package.LanguageService.10.0.dll 中)

语法

声明
Public Function GetSelection As TextSpan
public TextSpan GetSelection()

返回值

类型:Microsoft.VisualStudio.TextManager.Interop.TextSpan
包含选定文本的范围的 TextSpan 对象。

备注

此帮助器方法调用在 ExpansionProvider 对象包含的 IVsTextView 对象的 GetSelection 方法。 如果 ExpansionProvider 对象不可用,则返回的 TextSpan 对象对于其所有字段设置为 0。

.NET Framework 安全性

请参见

参考

ExpansionFunction 类

Microsoft.VisualStudio.Package 命名空间