SnapshotPoint::Subtraction Operator (SnapshotPoint, SnapshotPoint)

 

Calculates the offset between two SnapshotPoint objects.

Namespace:   Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

public:
static int operator -(
	SnapshotPoint start,
	SnapshotPoint other
)

Parameters

start
Type: Microsoft.VisualStudio.Text::SnapshotPoint

The starting point.

other
Type: Microsoft.VisualStudio.Text::SnapshotPoint

The point from which to calculate the offset.

Return Value

Type: System::Int32

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

Exception Condition
ArgumentException

The two points do not belong to the same snapshot.

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

Return to top
Show: