共用方式為


SnapshotPoint.Subtraction Operator

Definition

Overloads

Subtraction(SnapshotPoint, SnapshotPoint)

Computes the offset between two SnapshotPoint objects.

Subtraction(SnapshotPoint, Int32)

Decrements the position of a snapshot point.

Subtraction(SnapshotPoint, SnapshotPoint)

Computes the offset between two SnapshotPoint objects.

public:
 static int operator -(Microsoft::VisualStudio::Text::SnapshotPoint start, Microsoft::VisualStudio::Text::SnapshotPoint other);
public static int operator - (Microsoft.VisualStudio.Text.SnapshotPoint start, Microsoft.VisualStudio.Text.SnapshotPoint other);
static member ( - ) : Microsoft.VisualStudio.Text.SnapshotPoint * Microsoft.VisualStudio.Text.SnapshotPoint -> int
Public Shared Operator - (start As SnapshotPoint, other As SnapshotPoint) As Integer

Parameters

start
SnapshotPoint

The starting point.

other
SnapshotPoint

The point from which to compute the offset.

Returns

The offset between the two points, equivalent to start.Position - other.Position.

Exceptions

The two points do not belong to the same snapshot.

Remarks

The following should always be true: start == other + (start - other).

Applies to

Subtraction(SnapshotPoint, Int32)

Decrements the position of a snapshot point.

public:
 static Microsoft::VisualStudio::Text::SnapshotPoint operator -(Microsoft::VisualStudio::Text::SnapshotPoint point, int offset);
public static Microsoft.VisualStudio.Text.SnapshotPoint operator - (Microsoft.VisualStudio.Text.SnapshotPoint point, int offset);
static member ( - ) : Microsoft.VisualStudio.Text.SnapshotPoint * int -> Microsoft.VisualStudio.Text.SnapshotPoint
Public Shared Operator - (point As SnapshotPoint, offset As Integer) As SnapshotPoint

Parameters

point
SnapshotPoint

The point from which to calculate the new position.

offset
Int32

The offset of the new point.

Returns

An integer representing the position.

Exceptions

The new point is less than zero or greater than Snapshot.Length.

Applies to