OSPlatform.Equals Method

Definition

Determines whether two OSPlatform instances are equal.

Overloads

Equals(Object)

Determines whether the current OSPlatform instance is equal to the specified object.

Equals(OSPlatform)

Determines whether the current instance and the specified OSPlatform instance are equal.

Equals(Object)

Source:
OSPlatform.cs
Source:
OSPlatform.cs
Source:
OSPlatform.cs

Determines whether the current OSPlatform instance is equal to the specified object.

C#
public override bool Equals(object? obj);
C#
public override bool Equals(object obj);

Parameters

obj
Object

true if obj is a OSPlatform instance and its name is the same as the current object; otherwise, false.

Returns

true if obj is a OSPlatform instance and its name is the same as the current object.

Remarks

The name of an OSPlatform object is the osPlatform string passed to the Create method. 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.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1

Equals(OSPlatform)

Source:
OSPlatform.cs
Source:
OSPlatform.cs
Source:
OSPlatform.cs

Determines whether the current instance and the specified OSPlatform instance are equal.

C#
public bool Equals(System.Runtime.InteropServices.OSPlatform other);

Parameters

other
OSPlatform

The object to compare with the current instance.

Returns

true if the current instance and other are equal; otherwise, false.

Implements

Remarks

Two OSPlatform instances are equal if they have the same name. The name of an OSPlatform object is the osPlatform string passed to the Create method. 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.

Applies to

.NET 10 i druge verzije
Proizvod Verzije
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 1.1, 1.2, 1.3, 1.4, 1.6, 2.0, 2.1