Esempio n. 1
0
 public override bool Equals(object obj)
 {
     if (!(obj is Date))
     {
         return(false);
     }
     return(Months.Equals(((Date)obj).Months));
 }
Esempio n. 2
0
        public bool Equals(CoarseDuration other)
        {
            if (ReferenceEquals(other, null))
            {
                return(false);
            }

            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return(Years.Equals(other.Years) &&
                   Months.Equals(other.Months) &&
                   Days.Equals(other.Days) &&
                   Hours.Equals(other.Hours) &&
                   Minutes.Equals(other.Minutes) &&
                   Seconds.Equals(other.Seconds) &&
                   Sign.Equals(other.Sign));
        }
Esempio n. 3
0
        /// <summary>
        /// Returns true if OutputDateDifference instances are equal
        /// </summary>
        /// <param name="other">Instance of OutputDateDifference to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OutputDateDifference other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Years == other.Years ||

                     Years.Equals(other.Years)
                     ) &&
                 (
                     Months == other.Months ||

                     Months.Equals(other.Months)
                 ) &&
                 (
                     Days == other.Days ||

                     Days.Equals(other.Days)
                 ) &&
                 (
                     Hours == other.Hours ||

                     Hours.Equals(other.Hours)
                 ) &&
                 (
                     Minutes == other.Minutes ||

                     Minutes.Equals(other.Minutes)
                 ) &&
                 (
                     Milliseconds == other.Milliseconds ||

                     Milliseconds.Equals(other.Milliseconds)
                 ) &&
                 (
                     TotalYears == other.TotalYears ||

                     TotalYears.Equals(other.TotalYears)
                 ) &&
                 (
                     TotalMonths == other.TotalMonths ||

                     TotalMonths.Equals(other.TotalMonths)
                 ) &&
                 (
                     TotalDays == other.TotalDays ||

                     TotalDays.Equals(other.TotalDays)
                 ) &&
                 (
                     TotalHours == other.TotalHours ||

                     TotalHours.Equals(other.TotalHours)
                 ) &&
                 (
                     TotalMinutes == other.TotalMinutes ||

                     TotalMinutes.Equals(other.TotalMinutes)
                 ) &&
                 (
                     TotalSeconds == other.TotalSeconds ||

                     TotalSeconds.Equals(other.TotalSeconds)
                 ) &&
                 (
                     TotalMilliseconds == other.TotalMilliseconds ||

                     TotalMilliseconds.Equals(other.TotalMilliseconds)
                 ) &&
                 (
                     Ticks == other.Ticks ||

                     Ticks.Equals(other.Ticks)
                 ));
        }