/// <summary> /// Try to parse the given string as a 7-byte RFID UID. /// </summary> /// <param name="Text">A text representation of a 7-byte RFID UID.</param> /// <param name="RFIDUID7">The parsed 7-byte RFID UID.</param> public static Boolean TryParse(String Text, out RFIDUID7 RFIDUID7) { #region Initial checks if (Text != null) { Text = Text.Trim(); } if (Text.IsNullOrEmpty()) { RFIDUID7 = default; return(false); } #endregion try { RFIDUID7 = new RFIDUID7(Text); return(true); } catch (Exception) { } RFIDUID7 = default; return(false); }
/// <summary> /// Compares two 7-byte RFID UIDs for equality. /// </summary> /// <param name="RFIDUID7">A 7-byte RFID UID to compare with.</param> /// <returns>True if both match; False otherwise.</returns> public Boolean Equals(RFIDUID7 RFIDUID7) { if ((Object)RFIDUID7 == null) { return(false); } return(InternalId.ToLower().Equals(RFIDUID7.InternalId.ToLower())); }
/// <summary> /// Compares two instances of this object. /// </summary> /// <param name="RFIDUID7">An object to compare with.</param> public Int32 CompareTo(RFIDUID7 RFIDUID7) { if ((Object)RFIDUID7 == null) { throw new ArgumentNullException(nameof(RFIDUID7), "The given 7-byte RFID UID must not be null!"); } return(String.Compare(InternalId, RFIDUID7.InternalId, StringComparison.OrdinalIgnoreCase)); }