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