다음을 통해 공유


IOvertypeManager.TryStartOvertypeSession Method

Definition

Overloads

TryStartOvertypeSession(SnapshotSpan)

Starts a new overtype session for the given snapshot span.

TryStartOvertypeSession(SnapshotSpan, Boolean)

Starts a new overtype session for the given snapshot span.

TryStartOvertypeSession(SnapshotSpan)

Starts a new overtype session for the given snapshot span.

public bool TryStartOvertypeSession (Microsoft.VisualStudio.Text.SnapshotSpan snapshotSpan);
abstract member TryStartOvertypeSession : Microsoft.VisualStudio.Text.SnapshotSpan -> bool
Public Function TryStartOvertypeSession (snapshotSpan As SnapshotSpan) As Boolean

Parameters

snapshotSpan
SnapshotSpan

The range on which overtype should be possible.

Returns

Returns True if the session has been created.

Remarks

A session will be created only if the caret position is within the given snapshotSpan range.

If all the characters in the snapshotSpan to the left and right of the caret are identical at the moment when the session is created (for example, "|"), then all the characters on the left and right can be overtyped.

If characters to the left and right of the snapshotSpan are different, then only characters to the right of the caret can be overtyped. For example, creating a session on `` will only allow to overtype `-->`.

Applies to

TryStartOvertypeSession(SnapshotSpan, Boolean)

Starts a new overtype session for the given snapshot span.

public bool TryStartOvertypeSession (Microsoft.VisualStudio.Text.SnapshotSpan snapshotSpan, bool allowOvertypeCaretPrefix);
abstract member TryStartOvertypeSession : Microsoft.VisualStudio.Text.SnapshotSpan * bool -> bool
Public Function TryStartOvertypeSession (snapshotSpan As SnapshotSpan, allowOvertypeCaretPrefix As Boolean) As Boolean

Parameters

snapshotSpan
SnapshotSpan

The range on which overtype should be possible.

allowOvertypeCaretPrefix
Boolean

(optional) Indicates whether the span before the caret can be overtyped.

Returns

Returns True if the session has been created.

Remarks

A session will be created only if the caret position is within the given snapshotSpan range.

If all the characters in the snapshotSpan to the left and right of the caret are identical at the moment when the session is created (for example, "|") and that allowOvertypeCaretPrefix is true, then all the characters on the left and right can be overtyped.

If characters to the left and right of the snapshotSpan are different, then only characters to the right of the caret can be overtyped. For example, creating a session on `` will only allow to overtype `-->`.

Applies to