Example #1
0
        private static ExTimeZone GetRecurringTimeZoneFromQueryItem(object[] matchedItem)
        {
            string timeZoneDisplayName = matchedItem[CalendarImporter.QueryIndexOfProperty(CalendarItemBaseSchema.TimeZone)] as string;

            byte[] o11TimeZoneBlob = matchedItem[CalendarImporter.QueryIndexOfProperty(CalendarItemBaseSchema.TimeZoneBlob)] as byte[];
            byte[] o12TimeZoneBlob = matchedItem[CalendarImporter.QueryIndexOfProperty(CalendarItemBaseSchema.TimeZoneDefinitionRecurring)] as byte[];
            return(TimeZoneHelper.GetTimeZoneFromProperties(timeZoneDisplayName, o11TimeZoneBlob, o12TimeZoneBlob));
        }
Example #2
0
 private bool IsMeetingChanged(GlobalObjectId goid, Item promotedItem, object[] matchedItem)
 {
     for (int i = 0; i < InternetCalendarSchema.ImportCompare.Length; i++)
     {
         PropertyDefinition propertyDefinition = InternetCalendarSchema.ImportCompare[i];
         object             obj  = matchedItem[i];
         object             obj2 = promotedItem.TryGetProperty(propertyDefinition);
         if (!Util.ValueEquals(obj, obj2))
         {
             if (!(obj is PropertyError) && !(obj2 is PropertyError))
             {
                 if (propertyDefinition == CalendarItemBaseSchema.AppointmentRecurrenceBlob)
                 {
                     InternalRecurrence internalRecurrence = InternalRecurrence.InternalParse((byte[])obj, (VersionedId)matchedItem[this.QueryIndexId], CalendarImporter.GetRecurringTimeZoneFromQueryItem(matchedItem), promotedItem.PropertyBag.ExTimeZone, CalendarItem.DefaultCodePage);
                     InternalRecurrence recurrenceFromItem = CalendarItem.GetRecurrenceFromItem(promotedItem);
                     ExTraceGlobals.SharingTracer.TraceDebug <InternalRecurrence, InternalRecurrence, GlobalObjectId>((long)this.GetHashCode(), "CalendarImporter::IsMeetingChanged. Comparing property AppointmentRecurrenceBlob: old Recurrence is {0}; new Recurrence is {1}. GOID:{2}.", internalRecurrence, recurrenceFromItem, goid);
                     if (Util.ValueEquals(internalRecurrence, recurrenceFromItem) && Util.ValueEquals(internalRecurrence.GetDeletedOccurrences(false), recurrenceFromItem.GetDeletedOccurrences(false)))
                     {
                         goto IL_214;
                     }
                 }
                 if (true.Equals(promotedItem.TryGetProperty(CalendarItemBaseSchema.IsException)) && (propertyDefinition == ItemSchema.TimeZoneDefinitionStart || propertyDefinition == CalendarItemBaseSchema.TimeZoneDefinitionEnd))
                 {
                     ExTimeZone exTimeZone;
                     O12TimeZoneFormatter.TryParseTimeZoneBlob((byte[])obj, string.Empty, out exTimeZone);
                     ExTimeZone exTimeZone2;
                     O12TimeZoneFormatter.TryParseTimeZoneBlob((byte[])obj2, string.Empty, out exTimeZone2);
                     ExTraceGlobals.SharingTracer.TraceDebug((long)this.GetHashCode(), "CalendarImporter::IsMeetingChanged. Comparing property {0}: old TimeZone is {1}; new TimeZone is {2}. GOID:{3}.", new object[]
                     {
                         propertyDefinition.Name,
                         (exTimeZone != null) ? exTimeZone.AlternativeId : "null",
                         (exTimeZone2 != null) ? exTimeZone2.AlternativeId : "null",
                         goid
                     });
                     if (exTimeZone != null && exTimeZone2 != null)
                     {
                         REG_TIMEZONE_INFO reg_TIMEZONE_INFO  = TimeZoneHelper.RegTimeZoneInfoFromExTimeZone(exTimeZone, (ExDateTime)matchedItem[CalendarImporter.QueryIndexOfProperty(CalendarItemInstanceSchema.StartTime)]);
                         REG_TIMEZONE_INFO reg_TIMEZONE_INFO2 = TimeZoneHelper.RegTimeZoneInfoFromExTimeZone(exTimeZone2, (ExDateTime)promotedItem.TryGetProperty(CalendarItemInstanceSchema.StartTime));
                         if (Util.ValueEquals(reg_TIMEZONE_INFO, reg_TIMEZONE_INFO2))
                         {
                             goto IL_214;
                         }
                     }
                 }
             }
             ExTraceGlobals.SharingTracer.TraceDebug((long)this.GetHashCode(), "CalendarImporter::IsMeetingChanged. Change is detected on property {0}: old value is {1}; new value is {2}. GOID:{3}; Subject:{4}; StartTime:{5}.", new object[]
             {
                 propertyDefinition.Name,
                 obj,
                 obj2,
                 goid,
                 promotedItem.TryGetProperty(ItemSchema.Subject),
                 promotedItem.TryGetProperty(CalendarItemInstanceSchema.StartTime)
             });
             return(true);
         }
         IL_214 :;
     }
     return(false);
 }