Size3D.Inequality(Size3D, Size3D) Operator

Definition

Compares two Size3D structures for inequality. Two Size3D structures are not equal if the values of their X, Y and Z properties are different.

C#
public static bool operator !=(System.Windows.Media.Media3D.Size3D size1, System.Windows.Media.Media3D.Size3D size2);

Parameters

size1
Size3D

The first Size3D structure to compare.

size2
Size3D

The second Size3D structure to compare.

Returns

true if the X, Y and Z coordinates of size1 and size2 are different; otherwise, false.

Examples

The following example shows how to use the overloaded inequality operator to check if two Size3D structures are not equal.

C#
// Checks if two Size3D structures are not equal using the overloaded != operator. 
// Returns a Boolean.

Size3D size1 = new Size3D(2, 4, 6);
Size3D size2 = new Size3D(5, 10, 15);
Boolean areNotEqual;

areNotEqual = size1 != size2;
// areNotEqual is True

// Displaying Results
syntaxString = "areNotEqual = size1 != size2;";
resultType = "Boolean";
operationString = "Checking if two Size3D structures are not equal";
ShowResults(areNotEqual.ToString(), syntaxString, resultType, operationString);

Remarks

Because Double values can lose precision when arithmetic operations are performed on them, a comparison between two Size3D instances that are logically equal might fail.

Applies to

Proizvod Verzije
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10