Exemplo n.º 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()));
        }
Exemplo n.º 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));
        }
Exemplo n.º 3
0
        public override int GetHashCode()
        {
            var hash = ProviderName.GetHashCode();

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