Exemplo n.º 1
0
 private void UpdateInterval()
 {
     if (IntervalStart > IntervalEnd)
     {
         PrintInterval = new TimeInterval(IntervalStart, IntervalStart.AddDays(1));
     }
     PrintInterval = new TimeInterval(IntervalStart, IntervalEnd);
 }
Exemplo n.º 2
0
        public override int GetHashCode()
        {
            unchecked
            {
                var hashCode = IntervalStart.GetHashCode();
                hashCode = (hashCode * 397) ^ IntervalEnd.GetHashCode();
                hashCode = (hashCode * 397) ^ EqualityComparer <TPayload> .Default.GetHashCode(Payload);

                return(hashCode);
            }
        }
Exemplo n.º 3
0
        }         // DeepClone

        /// <summary>
        /// Indicates whether the current object is equal to another object of the same type.
        /// </summary>
        /// <returns>
        /// true if the current object is equal to the <paramref name="other"/> parameter; otherwise, false.
        /// </returns>
        /// <param name="other">An object to compare with this object.</param>
        public bool Equals(BadPeriod other)
        {
            if (other == null)
            {
                return(false);
            }

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

            return(IntervalStart.Equals(other.IntervalStart) && IntervalEnd.Equals(other.IntervalEnd));
        }         // Equals
Exemplo n.º 4
0
        public override int GetHashCode()
        {
            var hashCode = 1900018414;

            hashCode = hashCode * -1521134295 + IntervalStart.GetHashCode();
            hashCode = hashCode * -1521134295 + IntervalEnd.GetHashCode();
            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(LotteryNumber);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(myID);

            hashCode = hashCode * -1521134295 + myStatus.GetHashCode();
            hashCode = hashCode * -1521134295 + UserID.GetHashCode();
            return(hashCode);
        }
        public override string ToString()
        {
            char   bracket_a, bracket_b;
            string res;

            bracket_a = b_strict_a ? '(' : '[';
            bracket_b = b_strict_b ? ')' : ']';

            if (IntervalStart != IntervalEnd)
            {
                return(bracket_a + IntervalStart.ToString() + "; " + IntervalEnd.ToString() + bracket_b);
            }
            else
            {
                return(bracket_a + IntervalStart.ToString() + bracket_b);
            }
        }
Exemplo n.º 6
0
        }         // GetHashCode

        public override string ToString()
        {
            return(string.Format("{0} - {1}", IntervalStart.MomentStr(), IntervalEnd.MomentStr()));
        } // ToString
Exemplo n.º 7
0
        }         // Equals

        public override int GetHashCode()
        {
            return(IntervalStart.GetHashCode() ^ IntervalEnd.GetHashCode());
        }         // GetHashCode