共用方式為


Size3D.Inequality(Size3D, Size3D) 運算子

定義

比較兩個 Size3D 結構是否相等。 如果兩個 Size3D 結構的 XYZ 屬性值不同,則這兩個結構不相等。

public:
 static bool operator !=(System::Windows::Media::Media3D::Size3D size1, System::Windows::Media::Media3D::Size3D size2);
public static bool operator != (System.Windows.Media.Media3D.Size3D size1, System.Windows.Media.Media3D.Size3D size2);
static member op_Inequality : System.Windows.Media.Media3D.Size3D * System.Windows.Media.Media3D.Size3D -> bool
Public Shared Operator != (size1 As Size3D, size2 As Size3D) As Boolean

參數

size1
Size3D

要比較的第一個 Size3D 結構。

size2
Size3D

要比較的第二個 Size3D 結構。

傳回

Boolean

如果 size1size2XYZ 座標不同則為 true,否則為 false

範例

下列範例示範如何使用多載不等比較運算子來檢查兩 Size3D 個結構是否不相等。

// 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);
' Checks if two Size3D structures are not equal using the overloaded != operator. 
' Returns a Boolean.

Dim size1 As New Size3D(2, 4, 6)
Dim size2 As New Size3D(5, 10, 15)
Dim areNotEqual As Boolean

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)

備註

由於在算數運算上執行算數運算時,值可能會失去精確度,因此 Double 邏輯上相等的兩 Size3D 個實例之間的比較可能會失敗。

適用於