Beispiel #1
0
        internal static void EnsureMinutesBeforeStartIsInRange(Item item, int consumerDefaultMinutesBeforeStart)
        {
            int valueOrDefault = item.GetValueOrDefault <int>(InternalSchema.ReminderMinutesBeforeStart);
            int num            = Reminder.NormalizeMinutesBeforeStart(valueOrDefault, consumerDefaultMinutesBeforeStart);

            if (valueOrDefault != num)
            {
                if (valueOrDefault != 1525252321 || !(item is MeetingMessage))
                {
                    ExTraceGlobals.StorageTracer.TraceDebug <int, int, string>((long)item.GetHashCode(), "Value for ReminderMinutesBeforeStart is outside of the legitimate bounds: {0}, using {1} instead. Item class = {2}", valueOrDefault, num, item.ClassName);
                }
                item[InternalSchema.ReminderMinutesBeforeStart] = num;
            }
        }
Beispiel #2
0
        public static ExDateTime GetNominalReminderTimeForOccurrence(IStorePropertyBag recurringMasterItem, OccurrenceInfo occurrence)
        {
            ExceptionInfo exceptionInfo = occurrence as ExceptionInfo;
            int           num;

            if (exceptionInfo != null && (exceptionInfo.ModificationType & ModificationType.ReminderDelta) == ModificationType.ReminderDelta)
            {
                num = Reminder.NormalizeMinutesBeforeStart(exceptionInfo.PropertyBag.GetValueOrDefault <int>(ItemSchema.ReminderMinutesBeforeStart, 15), 15);
            }
            else
            {
                num = Reminder.NormalizeMinutesBeforeStart(recurringMasterItem.GetValueOrDefault <int>(ItemSchema.ReminderMinutesBeforeStartInternal, 15), 15);
            }
            return(occurrence.StartTime.AddMinutes((double)(-(double)num)));
        }
Beispiel #3
0
        protected void DemoteReminder()
        {
            if (base.Context.Method != CalendarMethod.Request && base.Context.Method != CalendarMethod.Publish)
            {
                return;
            }
            if (!this.item.GetValueOrDefault <bool>(InternalSchema.ReminderIsSetInternal))
            {
                return;
            }
            int?valueAsNullable = this.item.GetValueAsNullable <int>(InternalSchema.ReminderMinutesBeforeStartInternal);

            if (valueAsNullable == null)
            {
                return;
            }
            valueAsNullable = new int?(Reminder.NormalizeMinutesBeforeStart(valueAsNullable.Value, 15));
            TimeSpan minutes = ((double)valueAsNullable.Value != TimeSpan.MinValue.TotalMinutes) ? TimeSpan.FromMinutes((double)valueAsNullable.Value).Negate() : TimeSpan.FromMinutes(-15.0);

            VAlarm.Demote(base.OutboundContext.Writer, minutes, "REMINDER", null);
        }
Beispiel #4
0
        protected static ExDateTime?GetDefaultReminderNextTime(ExDateTime?dueBy, int minutesBeforeStart)
        {
            if (dueBy == null)
            {
                return(null);
            }
            int        num = Reminder.NormalizeMinutesBeforeStart(minutesBeforeStart, 15);
            ExDateTime?result;

            try
            {
                if (dueBy <= ExDateTime.MinValue.AddMinutes((double)num))
                {
                    num = 15;
                }
                result = new ExDateTime?(dueBy.Value.AddMinutes((double)(-(double)num)));
            }
            catch (ArgumentOutOfRangeException)
            {
                result = new ExDateTime?(dueBy.Value);
            }
            return(result);
        }