Esempio n. 1
0
        // Token: 0x060007DB RID: 2011 RVA: 0x00038E54 File Offset: 0x00037054
        protected Dictionary <SynchronizableFolderType, List <FolderRow> > GetSynchronizableFolderRows(MailboxSession mailboxSession, object[][] rows)
        {
            Dictionary <SynchronizableFolderType, List <FolderRow> > dictionary = CalendarSyncAssistantHelper.CreateSynchronizableFolderRowsDictionary();

            for (int i = 0; i < rows.Length; i++)
            {
                FolderRow folderRow = FolderRow.FromRawData(rows[i]);
                SynchronizableFolderType synchronizableFolderType = SynchronizableFolderType.FromFolderRow(folderRow);
                if (synchronizableFolderType != null && !this.IsDeletedItemsFolder(mailboxSession, folderRow.ParentItemId))
                {
                    StoreObjectId folderId = folderRow.FolderId;
                    CalendarSyncAssistantHelper.Tracer.TraceDebug <object, string, PropertyDefinition>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.GetSynchronizableFolderRows identified folder id {1} as a synchronizable folder of type {2}.", TraceContext.Get(), folderId.ToString(), synchronizableFolderType.CounterProperty);
                    if (synchronizableFolderType.HasSubscription(mailboxSession, folderId))
                    {
                        CalendarSyncAssistantHelper.Tracer.TraceDebug <object, string>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.GetSynchronizableFolderRows found a subscription for folder id {1}.", TraceContext.Get(), folderId.ToString());
                        dictionary[synchronizableFolderType].Add(folderRow);
                    }
                }
            }
            return(dictionary);
        }
Esempio n. 2
0
        // Token: 0x060007DD RID: 2013 RVA: 0x00038F18 File Offset: 0x00037118
        protected virtual Dictionary <SynchronizableFolderType, List <FolderRow> > GetSynchronizableFolderRows(Folder rootFolder, ICollection <SynchronizableFolderType> desiredTypes)
        {
            Dictionary <SynchronizableFolderType, List <FolderRow> > dictionary = CalendarSyncAssistantHelper.CreateSynchronizableFolderRowsDictionary();

            using (QueryResult queryResult = rootFolder.FolderQuery(FolderQueryFlags.DeepTraversal, null, null, FolderRow.CalendarSyncAssistantFolderProps))
            {
                object[][] array = null;
                do
                {
                    array = queryResult.GetRows(10000);
                    CalendarSyncAssistantHelper.Tracer.TraceDebug <object, int>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.GetSynchronizableFolderRows retrieved {1} folder rows.", TraceContext.Get(), array.Length);
                    Dictionary <SynchronizableFolderType, List <FolderRow> > synchronizableFolderRows = this.GetSynchronizableFolderRows((MailboxSession)rootFolder.Session, array);
                    foreach (KeyValuePair <SynchronizableFolderType, List <FolderRow> > keyValuePair in synchronizableFolderRows)
                    {
                        if (desiredTypes.Contains(keyValuePair.Key))
                        {
                            dictionary[keyValuePair.Key].AddRange(keyValuePair.Value);
                        }
                    }
                }while (array.Length > 0);
            }
            return(dictionary);
        }