示例#1
0
 public override bool Equals(object obj)
 {
     return(obj is Timestamp @object &&
            Hours.Equals(@object.Hours) &&
            Minutes.Equals(@object.Minutes) &&
            Seconds.Equals(@object.Seconds) &&
            Milliseconds.Equals(@object.Milliseconds));
 }
示例#2
0
 public int CompareTo(Time other)
 {
     if (Hours.Equals(other.Hours))
     {
         if (Minutes.Equals(other.Minutes))
         {
             return(Seconds - other.Seconds);
         }
         else
         {
             return(Minutes - other.Minutes);
         }
     }
     else
     {
         return(Hours - other.Hours);
     }
 }
示例#3
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));
        }
 /// <summary>
 /// Gets if this Date is not initialized
 /// </summary>
 /// <returns><c>true</c> if the date is empty, <c>false</c> in another case</returns>
 public bool IsEmpty()
 {
     return(Millennium == 0 && Century == 0 && NormDate == null && Day.Equals("00") && Month.Equals("00") && Year.Equals("0000") && Hours.Equals("00") && Minutes.Equals("00") && Seconds.Equals("00") && PrecisionDate == null && TypeDate == null);
 }
示例#5
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)
                 ));
        }