private static bool SearchForCalendarItem(MailboxSession session, StoreObjectId folderId, GlobalObjectId globalObjectId, out bool isOrganizer, out string subject, out string organizerEmailAddress) { StoreId arg = null; isOrganizer = false; subject = null; organizerEmailAddress = null; using (CalendarFolder calendarFolder = CalendarFolder.Bind(session, folderId, null)) { PropertyBag calendarItemProperties = calendarFolder.GetCalendarItemProperties(globalObjectId.Bytes, MeetingOrganizerValidator.CalendarOrganizerProperties); if (calendarItemProperties == null) { ExTraceGlobals.StorageTracer.TraceDebug <string>(0L, "Related Calendar Item not found in calendar folder : '{0}'", calendarFolder.DisplayName); return(false); } arg = calendarItemProperties.GetValueOrDefault <VersionedId>(InternalSchema.ItemId); string valueOrDefault = calendarItemProperties.GetValueOrDefault <string>(InternalSchema.ItemClass); AppointmentStateFlags valueOrDefault2 = calendarItemProperties.GetValueOrDefault <AppointmentStateFlags>(InternalSchema.AppointmentStateInternal); isOrganizer = IsOrganizerProperty.GetForCalendarItem(valueOrDefault, valueOrDefault2); subject = calendarItemProperties.GetValueOrDefault <string>(InternalSchema.MapiSubject); organizerEmailAddress = calendarItemProperties.GetValueOrDefault <string>(InternalSchema.SentRepresentingEmailAddress); } ExTraceGlobals.SyncTracer.TraceDebug <StoreId, bool>(0L, "Related Calendar Item found. Id: {0}. Is Organizer? {1}", arg, isOrganizer); return(true); }