# Point4D.Equals 方法

## 重载

 Equals(Object) 确定指定的 Object 是否为 Point4D 结构，以及指定的 Object 的 X、Y、Z 和 W 属性是否与此 Point4D 结构的 X、Y、Z 和 W 属性相等。Determines whether the specified Object is a Point4D structure and if the X, Y, Z, and W properties of the specified Object are equal to the X, Y, Z, and W properties of this Point4D structure. Equals(Point4D) 比较两个 Point4D 结构是否相等。Compares two Point4D structures for equality. Equals(Point4D, Point4D) 比较两个 Point4D 结构是否相等。Compares two Point4D structures for equality.

## Equals(Object)

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

o
Object

Boolean

### 示例

``````// Compares an Object and a Point4D for equality using the non-static Equals method.

Point4D point1 = new Point4D(10, 5, 1, 4);
Point4D point2 = new Point4D(15, 40, 60, 75);
Boolean areEqual;

areEqual = point1.Equals(point2);
// areEqual is False.  point2 is a Point4D structure, but it is not equal to point1.

// Displaying Results
syntaxString = "areEqual = point1.Equals(point2);";
resultType = "Boolean";
operationString = "Checking if two 3D points are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
``````
``````' Compares an Object and a Point4D for equality using the non-static Equals method.

Dim point1 As New Point4D(10, 5, 1, 4)
Dim point2 As New Point4D(15, 40, 60, 75)
Dim areEqual As Boolean

areEqual = point1.Equals(point2)
' areEqual is False.  point2 is a Point4D structure, but it is not equal to point1.

' Displaying Results
syntaxString = "areEqual = point1.Equals(point2)"
resultType = "Boolean"
operationString = "Checking if two 3D points are equal"
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString)
``````

## Equals(Point4D)

``````public:
bool Equals(System::Windows::Media::Media3D::Point4D value);``````
``public bool Equals (System.Windows.Media.Media3D.Point4D value);``
``override this.Equals : System.Windows.Media.Media3D.Point4D -> bool``
``Public Function Equals (value As Point4D) As Boolean``

value
Point4D

Boolean

## Equals(Point4D, Point4D)

``````public:
static bool Equals(System::Windows::Media::Media3D::Point4D point1, System::Windows::Media::Media3D::Point4D point2);``````
``public static bool Equals (System.Windows.Media.Media3D.Point4D point1, System.Windows.Media.Media3D.Point4D point2);``
``static member Equals : System.Windows.Media.Media3D.Point4D * System.Windows.Media.Media3D.Point4D -> bool``
``Public Shared Function Equals (point1 As Point4D, point2 As Point4D) As Boolean``

point1
Point4D

point2
Point4D

Boolean

### 示例

``````// Checks if two Point4D structures are equal using the static Equals method.

// point1's x,y,z,w properties set when the structure is created
Point4D point1 = new Point4D(10, 5, 1, 4);

Point4D point2 = new Point4D();
Boolean areEqual;

// settting point2's x,y,z,w properties
point2.X = 15;
point2.Y = 40;
point2.Z = 60;
point2.W = 75;

areEqual = Point4D.Equals(point1, point2);
// areEqual is False

//Displaying Results
syntaxString = "areEqual = Point4D.Equals(point1, point2);";
resultType = "Boolean";
operationString = "Checking if 3D two points are equal";
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString);
``````
``````' Checks if two Point4D structures are equal using the static Equals method.

' point1's x,y,z,w properties set when the structure is created
Dim point1 As New Point4D(10, 5, 1, 4)

Dim point2 As New Point4D()
Dim areEqual As Boolean

' settting point2's x,y,z,w properties
point2.X = 15
point2.Y = 40
point2.Z = 60
point2.W = 75

areEqual = Point4D.Equals(point1, point2)
' areEqual is False

'Displaying Results
syntaxString = "areEqual = Point4D.Equals(point1, point2)"
resultType = "Boolean"
operationString = "Checking if 3D two points are equal"
ShowResults(areEqual.ToString(), syntaxString, resultType, operationString)
``````