Пример #1
0
        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">
        /// The <paramref name="obj"/> parameter is null.
        /// </exception>
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (!(obj is AstronomicalCalendar))
            {
                return(false);
            }
            var aCal = (AstronomicalCalendar)obj;

            return(DateWithLocation.Equals(aCal.DateWithLocation) && DateWithLocation.Location.Equals(aCal.DateWithLocation.Location) &&
                   AstronomicalCalculator.Equals(aCal.AstronomicalCalculator));
        }
Пример #2
0
        /// <summary>
        /// Determines whether the specified <see cref="System.Object"/> is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object"/> to compare with this instance.</param>
        /// <returns>
        ///     <c>true</c> if the specified <see cref="System.Object"/> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">
        /// The <paramref name="obj"/> parameter is null.
        /// </exception>
        public override bool Equals(object obj)
        {
            if (this == obj)
            {
                return(true);
            }
            if (!(obj is ZmanimCalendar))
            {
                return(false);
            }
            var zCal = (ZmanimCalendar)obj;

            // return getCalendar().ToMillisecondsFromEpoch().equals(zCal.getCalendar().ToMillisecondsFromEpoch())
            return(DateWithLocation.Equals(zCal.DateWithLocation) && DateWithLocation.Location.Equals(zCal.DateWithLocation.Location) &&
                   AstronomicalCalculator.Equals(zCal.AstronomicalCalculator));
        }