Exemple #1
0
        /// <summary>
        /// All valid schedules on an item.
        /// </summary>
        /// <param name="itemId">The id of the item to browse schedules for.</param>
        /// <returns>All valid publish schedules on the item.</returns>
        public IEnumerable <PublishSchedule> GetSchedules(ID itemId)
        {
            if (ID.IsNullOrEmpty(itemId))
            {
                return(Enumerable.Empty <PublishSchedule>());
            }

            return(AllSchedules.Where(
                       x => x.ItemToPublish != null &&
                       x.ItemToPublish.ID == itemId &&
                       !x.IsPublished));
        }
Exemple #2
0
        /// <summary>
        /// List of valid unpublished schedules in a period of time.
        /// </summary>
        /// <param name="fromDate">From <see cref="T:System.Datetime"/> date.</param>
        /// <param name="toDate">To <see cref="T:System.Datetime"/> date.</param>
        /// <returns>List of valid unpublished schedules in this period of time.</returns>
        public IEnumerable <PublishSchedule> GetUnpublishedSchedules(DateTime fromDate, DateTime toDate)
        {
            if (fromDate > toDate)
            {
                return(Enumerable.Empty <PublishSchedule>());
            }

            return(AllSchedules
                   .Where(x => x.ItemToPublish != null &&
                          !x.IsPublished &&
                          x.PublishDate >= fromDate &&
                          x.PublishDate <= toDate));
        }
        public IEnumerable <PublishSchedule> GetRecurrentSchedules(DateTime fromDate, DateTime toDate)
        {
            if (fromDate > toDate)
            {
                return(Enumerable.Empty <PublishSchedule>());
            }

            return(AllSchedules
                   .Where(x => x.ItemToPublish != null &&
                          x.IsPublished &&
                          x.RecurrenceType != RecurrenceType.None &&
                          x.PublishDate >= fromDate &&
                          x.PublishDate <= toDate
                          ));
        }