/// <summary> /// Returns true if UserPasswordChangeSubmit instances are equal /// </summary> /// <param name="other">Instance of UserPasswordChangeSubmit to be compared</param> /// <returns>Boolean</returns> public bool Equals(UserPasswordChangeSubmit other) { if (other is null) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( Uuid == other.Uuid || Uuid != null && Uuid.Equals(other.Uuid) ) && ( NewPassword == other.NewPassword || NewPassword != null && NewPassword.Equals(other.NewPassword) ) && ( NewPasswordConfirmed == other.NewPasswordConfirmed || NewPasswordConfirmed != null && NewPasswordConfirmed.Equals(other.NewPasswordConfirmed) ) && ( OldPassword == other.OldPassword || OldPassword != null && OldPassword.Equals(other.OldPassword) )); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (Uuid != null) { hashCode = hashCode * 59 + Uuid.GetHashCode(); } if (NewPassword != null) { hashCode = hashCode * 59 + NewPassword.GetHashCode(); } if (NewPasswordConfirmed != null) { hashCode = hashCode * 59 + NewPasswordConfirmed.GetHashCode(); } if (OldPassword != null) { hashCode = hashCode * 59 + OldPassword.GetHashCode(); } return(hashCode); } }
private void OnNewPasswordConfirmedMaskedChanged(Catel.Data.AdvancedPropertyChangedEventArgs args) { var oldValue = args.OldValue as string; var newValue = args.NewValue as string; if (((oldValue ?? string.Empty).Length + 1) == ((newValue ?? string.Empty).Length)) { var change = (newValue ?? string.Empty).Substring((oldValue ?? string.Empty).Length, 1); NewPasswordConfirmed += change; NewPasswordConfirmedMasked = NewPasswordConfirmedMasked.Replace(change, "*"); } else if ((oldValue ?? string.Empty).Length > (newValue ?? string.Empty).Length) { NewPasswordConfirmed = NewPasswordConfirmed.Substring(0, (newValue ?? string.Empty).Length); NewPasswordConfirmedMasked = NewPasswordConfirmedMasked.Substring(0, (newValue ?? string.Empty).Length); } }