Given the class as follows,
public class Number
{
public int X { get; set; }
public int Y { get; set; }
}
How to define an overload operato
Here is a short example of how to do it, but I very strongly recommend reading Guidelines for Overloading Equals() and Operator == (C# Programming Guide) to understand the interaction between Equals() and == and so on.
public class Number
{
public int X { get; set; }
public int Y { get; set; }
public static bool operator ==(Number a, Number b)
{
// TODO
}
}