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