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())); }
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)); }
public override int GetHashCode() { var hash = ProviderName.GetHashCode(); return(ScheduleIntervalDefinitions.Aggregate(hash, (currentHash, definition) => (hash * 397) ^ definition.GetHashCode())); }
public virtual bool IsHdoTime(DateTime timeToCheck) => ScheduleIntervalDefinitions.Any(definition => definition.IsHdoTime(timeToCheck));