Point.Inequality(Point, Point) Operador

Definição

Compara duas Point estruturas para desigualdade.

public:
 static bool operator !=(System::Windows::Point point1, System::Windows::Point point2);
public static bool operator !=(System.Windows.Point point1, System.Windows.Point point2);
static member op_Inequality : System.Windows.Point * System.Windows.Point -> bool
Public Shared Operator != (point1 As Point, point2 As Point) As Boolean

Parâmetros

point1
Point

O primeiro ponto a comparar.

point2
Point

O segundo ponto a comparar.

Devoluções

truese point1 e tiverem coordenadas diferentes point2 ou X ; Y se false e point1 tiverem as mesmas point2 coordenadas e XY .

Exemplos

O exemplo seguinte mostra como verificar se duas Point estruturas não são iguais, usando o operador sobrecarregado (!=).

private Boolean overloadedInequalityOperatorExample()
{
    Point point1 = new Point(20, 30);
    Point point2 = new Point(45, 70);

    // Check whether the two Points are not equal, using the overloaded 
    // inequality operator.
    // areNotEqual is True.
    Boolean areNotEqual = (point1 != point2);

    return areNotEqual;
}
Private Function overloadedInequalityOperatorExample() As Boolean
    Dim point1 As New Point(20, 30)
    Dim point2 As New Point(45, 70)

    ' Check whether the two Points are not equal, using the overloaded 
    ' inequality operator.
    ' areNotEqual is True.
    Dim areNotEqual As Boolean = (point1 <> point2)

    Return areNotEqual

End Function

Observações

Os pontos X e Y coordenadas de um ponto são descritos usando Double valores. Como Double os valores podem perder precisão quando operados, uma comparação entre dois Point valores logicamente iguais pode falhar.

Aplica-se a