/// <summary>
        ///     Returns true if EntityEventOportunity instances are equal
        /// </summary>
        /// <param name="other">Instance of EntityEventOportunity to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EntityEventOportunity other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Type == other.Type ||
                     Type.Equals(other.Type)
                     ) &&
                 (
                     TimeLeft == other.TimeLeft ||
                     TimeLeft.Equals(other.TimeLeft)
                 ) &&
                 (
                     EndTime == other.EndTime ||
                     EndTime.Equals(other.EndTime)
                 ));
        }
Esempio n. 2
0
        /// <summary>
        /// Fired every time timer's cycle elapses
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void HandleTimer(object sender, ElapsedEventArgs e)
        {
            TimeLeft = TimeLeft.Subtract(new TimeSpan(0, 0, 1));

            OnTimerUpdated.Invoke();

            if (TimeLeft.Equals(TimeSpan.Zero))
            {
                TimesUp();
            }
        }