SnapshotPoint.Subtraction 运算符 (SnapshotPoint, SnapshotPoint)

计算两个 SnapshotPoint 对象之间的偏移量。

命名空间:  Microsoft.VisualStudio.Text
程序集:  Microsoft.VisualStudio.Text.Data(在 Microsoft.VisualStudio.Text.Data.dll 中)

语法

声明
Public Shared Operator - ( _
    start As SnapshotPoint, _
    other As SnapshotPoint _
) As Integer
public static int operator -(
    SnapshotPoint start,
    SnapshotPoint other
)
public:
static int operator -(
    SnapshotPoint start, 
    SnapshotPoint other
)
static let inline(-)
        start:SnapshotPoint * 
        other:SnapshotPoint  : int
JScript 不支持重载运算符。

参数

返回值

类型:Int32
在两个点之间的偏移量,等效于 start.Position - other.Position.

异常

异常 条件
ArgumentException

两个点不属于同一快照。

备注

以下应始终为 true: start == other + (start - other)。

.NET Framework 安全性

请参阅

参考

SnapshotPoint 结构

Subtraction 重载

Microsoft.VisualStudio.Text 命名空间