예제 #1
0
        public override string ToString()
        {
            var sb = new StringBuilder().AppendFormat(SCHEDULE_FORMAT, ProviderName)
                     .AppendLine();

            return(ScheduleIntervalDefinitions.Aggregate(sb, (scheduleString, definition) => scheduleString.AppendLine(definition.ToString()), builder => builder.ToString()));
        }
예제 #2
0
        public bool Equals(HdoSchedule other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }

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

            return(ProviderName.Equals(other.ProviderName) &&
                   ScheduleIntervalDefinitions.SequenceEqual(other.ScheduleIntervalDefinitions));
        }
예제 #3
0
        public override int GetHashCode()
        {
            var hash = ProviderName.GetHashCode();

            return(ScheduleIntervalDefinitions.Aggregate(hash, (currentHash, definition) => (hash * 397) ^ definition.GetHashCode()));
        }
예제 #4
0
 public virtual bool IsHdoTime(DateTime timeToCheck) => ScheduleIntervalDefinitions.Any(definition => definition.IsHdoTime(timeToCheck));