예제 #1
0
        //=====================================================================

        /// <summary>
        /// This is overridden to allow copying of the additional properties
        /// </summary>
        /// <param name="p">The PDI object from which the settings are to be copied.</param>
        protected override void Clone(PDIObject p)
        {
            RecurringObject o = (RecurringObject)p;

            this.RecurrenceRules.CloneRange(o.RecurrenceRules);
            this.RecurDates.CloneRange(o.RecurDates);
            this.ExceptionRules.CloneRange(o.ExceptionRules);
            this.ExceptionDates.CloneRange(o.ExceptionDates);
        }
예제 #2
0
        /// <summary>
        /// Use some limitations to prevent overloading the server or timing out the page if possible
        /// </summary>
        /// <param name="ro">The recurring object</param>
        /// <param name="r">The recurrence to check</param>
        private void ApplyLimits(RecurringObject ro, Recurrence r)
        {
            if(r.Frequency > RecurFrequency.Hourly)
                r.MaximumOccurrences = 5000;

            if(r.MaximumOccurrences != 0)
            {
                if(r.MaximumOccurrences > 5000)
                    r.MaximumOccurrences = 5000;
            }
            else
                if(r.Frequency == RecurFrequency.Hourly)
                {
                    if(r.RecurUntil > ro.StartDateTime.DateTimeValue.AddYears(5))
                        r.RecurUntil = ro.StartDateTime.DateTimeValue.AddYears(5);
                }
                else
                    if(r.RecurUntil > ro.StartDateTime.DateTimeValue.AddYears(50))
                        r.RecurUntil = ro.StartDateTime.DateTimeValue.AddYears(50);
        }