Size3D.Inequality(Size3D, Size3D) 运算符
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
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
和 size2
的 X、Y 和 Z 坐标不相等,则为 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 个实例之间的比较可能会失败。