Version.IComparable.CompareTo(Object) 方法

定义

将当前 Version 对象与指定的对象进行比较,并返回二者相对值的一个指示。Compares the current Version object to a specified object and returns an indication of their relative values.

 virtual int System.IComparable.CompareTo(System::Object ^ version) = IComparable::CompareTo;
int IComparable.CompareTo (object version);
Function CompareTo (version As Object) As Integer Implements IComparable.CompareTo

参数

version
Object

要比较的对象,或为 nullAn object to compare, or null.

返回

一个带符号整数,它表示两个对象的相对值,如下表所示:A signed integer that indicates the relative values of the two objects, as shown in the following table:

返回值Return value含义Meaning
小于零Less than zero当前 Version 对象是 version 之前的一个版本。The current Version object is a version before version.
Zero当前 Version 对象是与 version 相同的版本。The current Version object is the same version as version.
大于零Greater than zero当前 Version 对象是 version 之后的一个版本。The current Version object is a version subsequent to version.

-or-

versionnullversion is null.

实现

注解

此成员是显式接口成员的实现。This member is an explicit interface member implementation.

适用于