Esempio n. 1
0
        public override int GetHashCode()
        {
            int hashCode = 464455539;

            if (AllowTipping != null)
            {
                hashCode += AllowTipping.GetHashCode();
            }

            if (SeparateTipScreen != null)
            {
                hashCode += SeparateTipScreen.GetHashCode();
            }

            if (CustomTipField != null)
            {
                hashCode += CustomTipField.GetHashCode();
            }

            if (TipPercentages != null)
            {
                hashCode += TipPercentages.GetHashCode();
            }

            if (SmartTipping != null)
            {
                hashCode += SmartTipping.GetHashCode();
            }

            return(hashCode);
        }
Esempio n. 2
0
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj == this)
            {
                return(true);
            }

            return(obj is TipSettings other &&
                   ((AllowTipping == null && other.AllowTipping == null) || (AllowTipping?.Equals(other.AllowTipping) == true)) &&
                   ((SeparateTipScreen == null && other.SeparateTipScreen == null) || (SeparateTipScreen?.Equals(other.SeparateTipScreen) == true)) &&
                   ((CustomTipField == null && other.CustomTipField == null) || (CustomTipField?.Equals(other.CustomTipField) == true)) &&
                   ((TipPercentages == null && other.TipPercentages == null) || (TipPercentages?.Equals(other.TipPercentages) == true)) &&
                   ((SmartTipping == null && other.SmartTipping == null) || (SmartTipping?.Equals(other.SmartTipping) == true)));
        }