Пример #1
0
 private TIME_OF_DAY enumerateEndTimePeriod()
 {
     if (EndTime.CompareTo(EARLIEST_START_TIME) >= 0)
     {
         return(TIME_OF_DAY.PM);
     }
     return(TIME_OF_DAY.AM);
 }
Пример #2
0
            public int CompareTo(ScheduleEvent other)
            {
                int num = EndTime.CompareTo(other.EndTime);

                if (num == 0)
                {
                    num = Id.CompareTo(other.Id);
                }
                return(num);
            }
Пример #3
0
            public int CompareTo(ExecutionThread other)
            {
                int result = EndTime.CompareTo(other.EndTime);

                if (result != 0)
                {
                    return(result);
                }

                return(Id.CompareTo(other.Id));
            }
Пример #4
0
        public int CompareTo(IMark other)
        {
            int rv = StartTime.CompareTo(other.StartTime);

            if (rv != 0)
            {
                return(rv);
            }

            return(EndTime.CompareTo(other.EndTime));
        }
Пример #5
0
 public int CompareTo(TransformationEvent other)
 {
     if (StartTime != other.StartTime)
     {
         return(StartTime.CompareTo(other.StartTime));
     }
     if (EndTime != other.EndTime)
     {
         return(EndTime.CompareTo(other.EndTime));
     }
     return(Transformtype.CompareTo(other.Transformtype));
 }
Пример #6
0
        public int CompareTo(Element other)
        {
            int rv = StartTime.CompareTo(other.StartTime);

            if (rv != 0)
            {
                return(rv);
            }
            else
            {
                return(EndTime.CompareTo(other.EndTime));
            }
        }
Пример #7
0
        public int CompareTo(HitObject other)
        {
            if ((this is HitObjectDummy) || (other is HitObjectDummy))
            {
                return(EndTime.CompareTo(other.EndTime));
            }

            if (StartTime == other.StartTime)
            {
                return(other.NewCombo.CompareTo(NewCombo));
            }
            return(StartTime.CompareTo(other.StartTime));
        }
Пример #8
0
        /// <summary>
        /// Compare commands by start time, then end time, then name
        /// </summary>
        public int CompareTo(S2VXCommand other)
        {
            var compare = StartTime.CompareTo(other.StartTime);

            if (compare == 0)
            {
                compare = EndTime.CompareTo(other.EndTime);
            }
            if (compare == 0)
            {
                compare = string.Compare(GetType().Name, other.GetType().Name, StringComparison.OrdinalIgnoreCase);
            }
            return(compare);
        }
Пример #9
0
        private bool CheckForShutdown()
        {
            if (State == StateType.Shutdown)
            {
                return(true);
            }

            if (EndTime.CompareTo(DateTime.Now) <= 0)
            {
                return(true);
            }

            return(false);
        }
Пример #10
0
        /// <summary>
        /// Compare StartTime, then EndTime.
        /// </summary>
        /// <remarks>
        /// Implemented IComparable for use with Array.Sort().
        /// </remarks>
        /// <param name="rvalue"></param>
        /// <returns></returns>
        public int CompareTo(TimedEvent rvalue)
        {
            if (rvalue == null)
            {
                throw new NullReferenceException();               // Cannot compare against null
            }
            int cmp = _StartTime.CompareTo(rvalue.StartTime);

            if (cmp == 0)
            {
                cmp = EndTime.CompareTo(rvalue.EndTime);
            }
            return(cmp);
        }
Пример #11
0
        /// <summary>
        /// return true if time falls within StartTime/EndTime
        /// </summary>
        /// <param name="time"></param>
        /// <returns></returns>
        private bool CheckDay(System.DateTime time)
        {
            if (NonStopSession)
            {
                throw new InvalidOperationException("NonStopSession is set -- this should never be called.");
            }
            if (StartDay < EndDay)
            {
                if (time.DayOfWeek < StartDay || time.DayOfWeek > EndDay)
                {
                    return(false);
                }
                else if (time.DayOfWeek < EndDay)
                {
                    return((StartDay < time.DayOfWeek) || (StartTime.CompareTo(time.TimeOfDay) <= 0));
                }
                else
                {
                    return((time.DayOfWeek < EndDay) || (EndTime.CompareTo(time.TimeOfDay) >= 0));
                }
            }

            if (EndDay < StartDay)
            {
                if (EndDay < time.DayOfWeek && time.DayOfWeek < StartDay)
                {
                    return(false);
                }
                else if (time.DayOfWeek < StartDay)
                {
                    return((time.DayOfWeek < EndDay) || (EndTime.CompareTo(time.TimeOfDay) >= 0));
                }
                else
                {
                    return((time.DayOfWeek > StartDay) || (StartTime.CompareTo(time.TimeOfDay) <= 0));
                }
            }

            //start day must be same as end day
            if (StartTime >= EndTime)
            {
                return(time.DayOfWeek != StartDay || CheckTime(time.TimeOfDay));
            }
            else
            {
                return(time.DayOfWeek == StartDay && CheckTime(time.TimeOfDay));
            }
        }
Пример #12
0
        private bool CheckDay(System.DateTime time)
        {
            if (StartDay < EndDay)
            {
                if (time.DayOfWeek < StartDay || time.DayOfWeek > EndDay)
                {
                    return(false);
                }
                else if (time.DayOfWeek < EndDay)
                {
                    return((StartDay < time.DayOfWeek) || (StartTime.CompareTo(time.TimeOfDay) <= 0));
                }
                else
                {
                    return((time.DayOfWeek < EndDay) || (EndTime.CompareTo(time.TimeOfDay) >= 0));
                }
            }

            if (EndDay < StartDay)
            {
                if (EndDay < time.DayOfWeek && time.DayOfWeek < StartDay)
                {
                    return(false);
                }
                else if (time.DayOfWeek < StartDay)
                {
                    return((time.DayOfWeek < EndDay) || (EndTime.CompareTo(time.TimeOfDay) >= 0));
                }
                else
                {
                    return((time.DayOfWeek > StartDay) || (StartTime.CompareTo(time.TimeOfDay) <= 0));
                }
            }

            //start day must be same as end day
            if (StartTime >= EndTime)
            {
                return(time.DayOfWeek != StartDay || CheckTime(time.TimeOfDay));
            }
            else
            {
                return(time.DayOfWeek == StartDay && CheckTime(time.TimeOfDay));
            }
        }
Пример #13
0
 public int CompareTo(StatusEffect other)
 {
     return(EndTime.CompareTo(other.EndTime));
 }
Пример #14
0
 public bool IsVisible(DateTime currentTime)
 {
     return(Tour.IsOpen && EndTime.CompareTo(currentTime) > 0);
 }
Пример #15
0
 public int CompareTo(int other)
 {
     return(EndTime.CompareTo(other));
 }