计算两个 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 不支持重载运算符。
参数
start
类型:Microsoft.VisualStudio.Text.SnapshotPoint拖动操作的起点。
other
类型:Microsoft.VisualStudio.Text.SnapshotPoint的点计算偏移量。
返回值
类型:Int32
在两个点之间的偏移量,等效于 start.Position - other.Position.
异常
异常 | 条件 |
---|---|
ArgumentException | 两个点不属于同一快照。 |
备注
以下应始终为 true: start == other + (start - other)。
.NET Framework 安全性
- 对直接调用方的完全信任。此成员不能由部分信任的代码使用。有关详细信息,请参阅通过部分受信任的代码使用库。