Exemple #1
0
        public static bool?IsOrganizer(MailboxSession mailboxSession, GlobalObjectId globalObjectId, out string subject, out string organizerEmailAddress)
        {
            ExTraceGlobals.SyncTracer.TraceDebug <GlobalObjectId, bool>(0L, "[MeetingOrganizerValidatior.IsOrganizer] Search IsOrganizer GOID: {0}, IsCleanGoID: {1}", globalObjectId, globalObjectId.IsCleanGlobalObjectId);
            subject = null;
            organizerEmailAddress = null;
            if (!globalObjectId.IsCleanGlobalObjectId)
            {
                globalObjectId = new GlobalObjectId(globalObjectId.CleanGlobalObjectIdBytes);
            }
            bool value = false;
            bool flag  = MeetingOrganizerValidator.SearchForCalendarItem(mailboxSession, mailboxSession.GetDefaultFolderId(DefaultFolderType.Calendar), globalObjectId, out value, out subject, out organizerEmailAddress);

            if (!flag)
            {
                ExTraceGlobals.SyncTracer.TraceDebug(0L, "[MeetingOrganizerValidatior.IsOrganizer] Correlated CalendarItem not found in default calendar folder.  Searching in calendar sub folders...");
                using (Folder folder = Folder.Bind(mailboxSession, DefaultFolderType.Calendar))
                {
                    using (QueryResult queryResult = folder.FolderQuery(FolderQueryFlags.DeepTraversal, null, null, MeetingOrganizerValidator.FetchProperties))
                    {
                        bool flag2 = true;
                        while (flag2)
                        {
                            object[][] rows = queryResult.GetRows(10000);
                            if (rows == null || rows.Length == 0)
                            {
                                break;
                            }
                            for (int i = 0; i < rows.Length; i++)
                            {
                                VersionedId   versionedId         = rows[i][0] as VersionedId;
                                StoreObjectId storeObjectId       = (versionedId != null) ? versionedId.ObjectId : null;
                                int?          num                 = rows[i][1] as int?;
                                int           extendedFolderFlags = (num != null) ? num.Value : 0;
                                if (storeObjectId == null || CalendarFolder.IsCrossOrgShareFolder(extendedFolderFlags) || CalendarFolder.IsInternetCalendar(extendedFolderFlags))
                                {
                                    ExTraceGlobals.SyncTracer.TraceDebug <StoreObjectId>(0L, "[MeetingOrganizerValidator.IsOrganizer] Skipping Calendar '{0}' as it is either a sharing folder or iCal folder", storeObjectId);
                                }
                                else
                                {
                                    flag = MeetingOrganizerValidator.SearchForCalendarItem(mailboxSession, storeObjectId, globalObjectId, out value, out subject, out organizerEmailAddress);
                                    if (flag)
                                    {
                                        flag2 = false;
                                        break;
                                    }
                                }
                            }
                        }
                    }
                    goto IL_16D;
                }
            }
            ExTraceGlobals.SyncTracer.TraceDebug(0L, "[MeetingOrganizerValidatior.IsOrganizer] Correlated CalendarItem found in default calendar folder");
IL_16D:
            if (!flag)
            {
                return(null);
            }
            return(new bool?(value));
        }
Exemple #2
0
 // Token: 0x06000842 RID: 2114 RVA: 0x0003A0A6 File Offset: 0x000382A6
 protected override bool MatchesExtendedFolderFlags(int extendedFolderFlags)
 {
     return(CalendarFolder.IsInternetCalendar(extendedFolderFlags));
 }