Version.Equals 方法

定义

返回一个值,该值指示两个 Version 对象是否表示同一个值。Returns a value indicating whether two Version object represent the same value.

重载

Equals(Object)

返回一个值,该值指示当前 Version 对象是否等于指定的对象。Returns a value indicating whether the current Version object is equal to a specified object.

Equals(Version)

返回一个值,该值指示当前 Version 对象和指定的 Version 对象是否表示同一个值。Returns a value indicating whether the current Version object and a specified Version object represent the same value.

Equals(Object)

返回一个值,该值指示当前 Version 对象是否等于指定的对象。Returns a value indicating whether the current Version object is equal to a specified object.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object obj);
public override bool Equals (object? obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

参数

obj
Object

要与当前 Version 对象进行比较的对象,或者为 nullAn object to compare with the current Version object, or null.

返回

Boolean

如果当前 Version 对象和 obj 都为 Version 对象,并且当前 Version 对象的每个部分都与 obj 的相应部分匹配,则为 true;否则为 falsetrue if the current Version object and obj are both Version objects, and every component of the current Version object matches the corresponding component of obj; otherwise, false.

另请参阅

适用于

Equals(Version)

返回一个值,该值指示当前 Version 对象和指定的 Version 对象是否表示同一个值。Returns a value indicating whether the current Version object and a specified Version object represent the same value.

public:
 virtual bool Equals(Version ^ obj);
public bool Equals (Version obj);
public bool Equals (Version? obj);
override this.Equals : Version -> bool
Public Function Equals (obj As Version) As Boolean

参数

obj
Version

要与当前的 Version 对象进行比较的 Version 对象,或者为 nullA Version object to compare to the current Version object, or null.

返回

Boolean

如果当前 Version 对象的每个部分都与 obj 参数的相应部分匹配,则为 true;否则为 falsetrue if every component of the current Version object matches the corresponding component of the obj parameter; otherwise, false.

实现

注解

此方法实现 IEquatable<T> 接口,其执行效果略好于 Equals 方法,因为它不需要取消装箱 obj 参数。This method implements the IEquatable<T> interface, and performs slightly better than the Equals method because it does not have to unbox the obj parameter.

另请参阅

适用于