public AdjacencyOrConflictInfo(OccurrenceInfo occurrenceInfo, string subject, string location, BusyType freeBusyType, AdjacencyOrConflictType type, byte[] globalObjectId, Sensitivity sensitivity, bool isAllDayEvent) { EnumValidator.ThrowIfInvalid <BusyType>(freeBusyType, "freeBusyType"); EnumValidator.ThrowIfInvalid <AdjacencyOrConflictType>(type, "type"); EnumValidator.ThrowIfInvalid <Sensitivity>(sensitivity, "sensitivity"); this.OccurrenceInfo = occurrenceInfo; this.Subject = subject; this.Location = location; this.FreeBusyStatus = freeBusyType; this.AdjacencyOrConflictType = type; this.GlobalObjectId = globalObjectId; this.Sensitivity = sensitivity; this.IsAllDayEvent = isAllDayEvent; }
internal object[] GetTruncatedRecurringMaster(object[] masterRow, ExDateTime windowStart, ExDateTime windowEnd, PropertyDefinition[] columns) { if (masterRow.Length != columns.Length) { throw new ArgumentException(ServerStrings.ExInvalidMasterValueAndColumnLength); } IList <OccurrenceInfo> occurrenceInfoList = this.recurrence.GetOccurrenceInfoList(windowStart, windowEnd); if (occurrenceInfoList.Count > 0) { OccurrenceInfo occurrenceInfo = occurrenceInfoList[0]; OccurrenceInfo occurrenceInfo2 = occurrenceInfoList[occurrenceInfoList.Count - 1]; int num = Array.IndexOf <PropertyDefinition>(columns, InternalSchema.MapiStartTime); int num2 = Array.IndexOf <PropertyDefinition>(columns, InternalSchema.MapiEndTime); if (num > 0) { masterRow[num] = occurrenceInfo.OccurrenceDateId + this.recurrence.StartOffset; } if (num2 > 0) { masterRow[num2] = occurrenceInfo.OccurrenceDateId + this.recurrence.EndOffset; } int num3 = Array.IndexOf <PropertyDefinition>(columns, InternalSchema.AppointmentRecurrenceBlob); if (num3 > 0) { int num4 = Array.IndexOf <PropertyDefinition>(columns, InternalSchema.GlobalObjectId); if (num4 > 0) { try { new GlobalObjectId(masterRow[num4] as byte[]); } catch (CorruptDataException) { } } InternalRecurrence truncatedRecurrence = this.GetTruncatedRecurrence(occurrenceInfo.OccurrenceDateId, occurrenceInfo2.OccurrenceDateId, windowEnd == ExDateTime.MaxValue); if (truncatedRecurrence != null) { masterRow[num3] = truncatedRecurrence.ToByteArray(); } } return(masterRow); } return(null); }
internal ExDateTime GetNextOccurrence(ExDateTime start) { if (start == ExDateTime.MaxValue) { return(ExDateTime.MaxValue); } OccurrenceInfo occurrenceInfo = new OccurrenceInfo(null, start.Date, start, ExDateTime.MaxValue, ExDateTime.MaxValue); if (base.Pattern is RegeneratingPattern) { return(base.GetNthOccurrence(start, 2)); } if (base.Range is NoEndRecurrenceRange || this.GetLastOccurrence().StartTime > start) { return(this.GetNextOccurrence(occurrenceInfo).StartTime); } return(ExDateTime.MaxValue); }
private void CalculateOccurrencesToRevive() { this.OccurrencesToRevive = new List <ExDateTime>(); foreach (ExDateTime exDateTime in this.NewRecurrence.GetDeletedOccurrences(false)) { ExDateTime date = exDateTime.Date; if (this.OriginalRecurrence.IsValidOccurrenceId(date) && !this.OriginalRecurrence.IsOccurrenceDeleted(date)) { OccurrenceInfo occurrenceInfoByDateId = this.OriginalRecurrence.GetOccurrenceInfoByDateId(date); using (CalendarItemOccurrence calendarItemOccurrence = CalendarItemOccurrence.Bind(this.Session, occurrenceInfoByDateId.VersionedId)) { if (calendarItemOccurrence.IsCancelled) { this.OccurrencesToRevive.Add(occurrenceInfoByDateId.OccurrenceDateId); } } } } ExTraceGlobals.RecurrenceTracer.Information <string>((long)this.GetHashCode(), "Storage.RecurrenceBlobMerger.CalculateOccurrencesToRevive: GOID={0}", this.GlobalObjectId); }
private void AdjustOccurrenceColumnsForExpansion(object[] occurrence, PropertyDefinition[] columns, OccurrenceInfo occurrenceInfo, int codePage, byte[] createdTimeZoneBlobCache, bool isException) { for (int i = 0; i < columns.Length; i++) { PropertyDefinition propertyDefinition = columns[i]; if (propertyDefinition.Equals(InternalSchema.ItemId)) { occurrence[i] = occurrenceInfo.VersionedId; } else if (propertyDefinition.Equals(InternalSchema.IsRecurring)) { occurrence[i] = true; } else if (propertyDefinition.Equals(InternalSchema.IsException)) { occurrence[i] = isException; } else if (propertyDefinition.Equals(InternalSchema.AppointmentRecurring)) { occurrence[i] = false; } else if (propertyDefinition.Equals(InternalSchema.AppointmentRecurrenceBlob)) { occurrence[i] = new PropertyError(columns[i], PropertyErrorCode.NotFound); } else if (propertyDefinition.Equals(InternalSchema.MapiStartTime) || propertyDefinition.Equals(InternalSchema.MapiPRStartDate)) { occurrence[i] = occurrenceInfo.StartTime; } else if (propertyDefinition.Equals(InternalSchema.MapiEndTime) || propertyDefinition.Equals(InternalSchema.MapiPREndDate)) { occurrence[i] = occurrenceInfo.EndTime; } else if (propertyDefinition.Equals(InternalSchema.TimeZoneDefinitionStart) || propertyDefinition.Equals(InternalSchema.TimeZoneDefinitionEnd)) { if (occurrence[i] is PropertyError) { occurrence[i] = createdTimeZoneBlobCache; } } else if (propertyDefinition.Equals(InternalSchema.ItemClass)) { occurrence[i] = (isException ? (occurrence[i] = "IPM.OLE.CLASS.{00061055-0000-0000-C000-000000000046}") : (occurrence[i] = "IPM.Appointment.Occurrence")); } else if (propertyDefinition.Equals(InternalSchema.GlobalObjectId)) { object obj = occurrence[Array.IndexOf <PropertyDefinition>(columns, InternalSchema.CleanGlobalObjectId)]; byte[] array = obj as byte[]; if (array != null) { occurrence[i] = new GlobalObjectId(array) { Date = ((OccurrenceStoreObjectId)occurrenceInfo.VersionedId.ObjectId).OccurrenceId }.Bytes; } else { PropertyError propertyError = obj as PropertyError; occurrence[i] = new PropertyError(InternalSchema.GlobalObjectId, propertyError.PropertyErrorCode, propertyError.PropertyErrorDescription); } } else if (propertyDefinition.Equals(InternalSchema.Codepage)) { occurrence[i] = codePage; } } }
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))); }
public OccurrenceCrossingBoundaryException(OccurrenceInfo occurrenceInfo, OccurrenceInfo neighborInfo, LocalizedString message, bool isSameDayInOrganizerTimeZone) : base(message, null) { this.OccurrenceInfo = occurrenceInfo; this.NeighborInfo = neighborInfo; this.IsSameDayInOrganizerTimeZone = isSameDayInOrganizerTimeZone; }