/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="ParkingProduct1">A parking product.</param> /// <param name="ParkingProduct2">Another parking product.</param> /// <returns>true|false</returns> public static Boolean operator >(ParkingProduct ParkingProduct1, ParkingProduct ParkingProduct2) { if ((Object)ParkingProduct1 == null) { throw new ArgumentNullException(nameof(ParkingProduct1), "The given ParkingProduct1 must not be null!"); } return(ParkingProduct1.CompareTo(ParkingProduct2) > 0); }
/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="ParkingProduct1">A parking product.</param> /// <param name="ParkingProduct2">Another parking product.</param> /// <returns>true|false</returns> public static Boolean operator ==(ParkingProduct ParkingProduct1, ParkingProduct ParkingProduct2) { // If both are null, or both are same instance, return true. if (Object.ReferenceEquals(ParkingProduct1, ParkingProduct2)) { return(true); } // If one is null, but not both, return false. if (((Object)ParkingProduct1 == null) || ((Object)ParkingProduct2 == null)) { return(false); } return(ParkingProduct1.Equals(ParkingProduct2)); }