ExpansionFunction.GetSelection 方法

定义

获取当前视图中选定文本的跨度。

public:
 Microsoft::VisualStudio::TextManager::Interop::TextSpan GetSelection();
public:
 Microsoft::VisualStudio::TextManager::Interop::TextSpan GetSelection();
Microsoft::VisualStudio::TextManager::Interop::TextSpan GetSelection();
public Microsoft.VisualStudio.TextManager.Interop.TextSpan GetSelection ();
member this.GetSelection : unit -> Microsoft.VisualStudio.TextManager.Interop.TextSpan
Public Function GetSelection () As TextSpan

返回

TextSpan

TextSpan包含所选文本跨度的对象。

注解

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

适用于