共用方式為


ITextSelection 介面

代表 ITextView 中的選取文字。

命名空間:  Microsoft.VisualStudio.Text.Editor
組件:  Microsoft.VisualStudio.Text.UI (在 Microsoft.VisualStudio.Text.UI.dll 中)

語法

'宣告
Public Interface ITextSelection
public interface ITextSelection
public interface class ITextSelection
type ITextSelection =  interface end
public interface ITextSelection

ITextSelection 類型會公開下列成員。

屬性

  名稱 描述
公用屬性 ActivationTracksFocus 決定是否IsActive應該追蹤何時ITextView取得和遺失焦點彙總。預設值為 true。
公用屬性 ActivePoint 取得選取範圍的現用點。
公用屬性 AnchorPoint 取得選取範圍的錨點。
公用屬性 End 取得選取範圍的結束點。
公用屬性 IsActive 是否將選取範圍才有作用。
公用屬性 IsEmpty 決定是否將選取範圍長度為零。
公用屬性 IsReversed 決定是否使用中的一點是 Span.Start,錨點 Span.End。
公用屬性 Mode 取得或設定選取模式。
公用屬性 SelectedSpans 目前選取的延伸。
公用屬性 Start 取得選取範圍的起始點。
公用屬性 StreamSelectionSpan 無論目前的選取模式為何,皆將其視為資料流選取模式以取得目前的選取範圍。
公用屬性 TextView 取得此選取範圍所屬的文字檢視。
公用屬性 VirtualSelectedSpans 目前選取的延伸 (VirtualSnapshotSpan 物件的形式)。

回頁首

方法

  名稱 描述
公用方法 Clear 將選取範圍為零長度、 開始及結束目前的選取範圍的邏輯結尾的位置。
公用方法 GetSelectionOnTextViewLine 取得選取項目上指定ITextViewLine
公用方法 Select(SnapshotSpan, Boolean) 選取指定的選取範圍中的文字。
公用方法 Select(VirtualSnapshotPoint, VirtualSnapshotPoint) 選取兩個 VirtualSnapshotPoint 物件之間的文字。

回頁首

事件

  名稱 描述
公用事件 SelectionChanged 發生於選取或清除所呼叫,以及當選取範圍是空的且會移動插入號。這是事件的寄件者ITextSelection。

回頁首

請參閱

參考

Microsoft.VisualStudio.Text.Editor 命名空間