OSPlatform.Equals 方法

定义

确定两个 OSPlatform 实例是否相等。Determines whether two OSPlatform instances are equal.

重载

Equals(Object)

确定当前 OSPlatform 实例是否与指定对象相等。Determines whether the current OSPlatform instance is equal to the specified object.

Equals(OSPlatform)

确定当前实例是否等同于指定的 OSPlatform 实例。Determines whether the current instance and the specified OSPlatform instance are equal.

Equals(Object)

确定当前 OSPlatform 实例是否与指定对象相等。Determines whether the current OSPlatform instance is equal to the specified object.

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

参数

obj
Object

如果 true 是一个 obj 实例,且其名称与当前对象相同,则为 OSPlatform;否则为 falsetrue if obj is a OSPlatform instance and its name is the same as the current object; otherwise, false.

返回

如果 true 是一个 obj 实例,且其名称与当前对象相同,则为 OSPlatformtrue if obj is a OSPlatform instance and its name is the same as the current object.

注解

OSPlatform 对象的名称是传递到 Create 方法的 osPlatform 字符串。The name of an OSPlatform object is the osPlatform string passed to the Create method. 静态 OSPlatform 属性返回的 OSPlatform 对象的名称是 "LINUX"、"OSX" 和 "WINDOWS"。The names of the OSPlatform objects returned by the static OSPlatform properties are "LINUX", "OSX", and "WINDOWS". 方法使用序号比较来确定名称是否相同。The method uses ordinal comparison to determine whether the names are the same.

Equals(OSPlatform)

确定当前实例是否等同于指定的 OSPlatform 实例。Determines whether the current instance and the specified OSPlatform instance are equal.

public:
 virtual bool Equals(System::Runtime::InteropServices::OSPlatform other);
public bool Equals (System.Runtime.InteropServices.OSPlatform other);
override this.Equals : System.Runtime.InteropServices.OSPlatform -> bool
Public Function Equals (other As OSPlatform) As Boolean

参数

other
OSPlatform

要与当前实例比较的对象。The object to compare with the current instance.

返回

如果当前实例与 true 相等,则为 other;否则为 falsetrue if the current instance and other are equal; otherwise, false.

实现

注解

如果两个 OSPlatform 实例的名称相同,则这两个实例相等。Two OSPlatform instances are equal if they have the same name. OSPlatform 对象的名称是传递到 Create 方法的 osPlatform 字符串。The name of an OSPlatform object is the osPlatform string passed to the Create method. 静态 OSPlatform 属性返回的 OSPlatform 对象的名称是 "LINUX"、"OSX" 和 "WINDOWS"。The names of the OSPlatform objects returned by the static OSPlatform properties are "LINUX", "OSX", and "WINDOWS". 方法使用序号比较来确定名称是否相同。The method uses ordinal comparison to determine whether the names are the same.

适用于