// Token: 0x060007FC RID: 2044 RVA: 0x00039774 File Offset: 0x00037974
 static SynchronizableFolderType()
 {
     SynchronizableFolderType.Register(new ConsumerSharingCalendarType());
     SynchronizableFolderType.Register(new ExternalSharingCalendarType());
     SynchronizableFolderType.Register(new InternetCalendarType());
     SynchronizableFolderType.Register(new ExternalSharingContactsType());
     WebCalendar.RegisterPrefixes();
 }
        // Token: 0x06000801 RID: 2049 RVA: 0x00039974 File Offset: 0x00037B74
        protected static void Register(SynchronizableFolderType folderType)
        {
            SynchronizableFolderType.allSynchronizableFolderTypes.Add(folderType);
            List <SynchronizableFolderType> list = new List <SynchronizableFolderType>(1);

            list.Add(folderType);
            SynchronizableFolderType.allLists.Add(folderType.GetType(), list);
        }
Esempio n. 3
0
 // Token: 0x060007E7 RID: 2023 RVA: 0x000395B8 File Offset: 0x000377B8
 private object GetSubscriptionCount(MailboxSession mailboxSession, SynchronizableFolderType folderType, bool needsToLoadProperty)
 {
     if (needsToLoadProperty)
     {
         mailboxSession.Mailbox.Load(new PropertyDefinition[]
         {
             folderType.CounterProperty
         });
     }
     return(mailboxSession.Mailbox.TryGetProperty(folderType.CounterProperty));
 }
Esempio n. 4
0
 // Token: 0x060007D9 RID: 2009 RVA: 0x00038DC4 File Offset: 0x00036FC4
 public void SetSubscriptionCount(MailboxSession mailboxSession, SynchronizableFolderType folderType, int value, bool needsToLoadProperty)
 {
     if (needsToLoadProperty)
     {
         mailboxSession.Mailbox.Load(new PropertyDefinition[]
         {
             folderType.CounterProperty
         });
     }
     mailboxSession.Mailbox[folderType.CounterProperty] = value;
     mailboxSession.Mailbox.Save();
     mailboxSession.Mailbox.Load();
     CalendarSyncAssistantHelper.Tracer.TraceDebug <PropertyDefinition, string, int>((long)this.GetHashCode(), "CalendarSyncAssistantHelper.SetSubscriptionCount for {0}: number of calendar subscriptions for mailbox {1} is {2}.", folderType.CounterProperty, mailboxSession.DisplayName, value);
 }
Esempio n. 5
0
 // Token: 0x060007E5 RID: 2021 RVA: 0x00039374 File Offset: 0x00037574
 private void ProcessFolder(MailboxSession mailboxSession, StoreObjectId folderId, CalendarSyncLogEntry logEntry)
 {
     CalendarSyncAssistantHelper.Tracer.TraceDebug <object, StoreObjectId, string>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantType.ProcessFolder will try to process folder {1} from mailbox {2}.", TraceContext.Get(), folderId, this.GetDisplayName(mailboxSession));
     using (Folder folder = Folder.Bind(mailboxSession, folderId))
     {
         SynchronizableFolderType            synchronizableFolderType            = SynchronizableFolderType.FromFolder(folder);
         CalendarSyncFolderOperationLogEntry calendarSyncFolderOperationLogEntry = new CalendarSyncFolderOperationLogEntry
         {
             MailboxGuid   = mailboxSession.MailboxGuid,
             FolderId      = folderId.ToString(),
             DisplayName   = folder.DisplayName,
             IsOnDemandJob = true,
             TenantGuid    = mailboxSession.MailboxOwner.MailboxInfo.OrganizationId.GetTenantGuid()
         };
         if (synchronizableFolderType != null)
         {
             FolderRow folderRow = FolderRow.FromFolder(folder);
             this.ThrowIfShuttingDown((mailboxSession != null) ? mailboxSession.MailboxOwner : null);
             if (!synchronizableFolderType.Synchronize(mailboxSession, folderRow, this.GetDeadline(SynchronizableFolderType.MaxSyncTimePerFolder), this.PerformanceCounters, calendarSyncFolderOperationLogEntry))
             {
                 CalendarSyncAssistantHelper.Tracer.TraceDebug((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.ProcessFolder: deadline expired while processing folder {1} from mailbox {2}. MaxSyncTime {3}.", new object[]
                 {
                     TraceContext.Get(),
                     folderId,
                     this.GetDisplayName(mailboxSession),
                     SynchronizableFolderType.MaxSyncTimePerFolder
                 });
                 calendarSyncFolderOperationLogEntry.IsDeadlineExpired = true;
             }
             else
             {
                 calendarSyncFolderOperationLogEntry.IsSyncSuccess = true;
             }
             calendarSyncFolderOperationLogEntry.FolderType = synchronizableFolderType.FolderTypeName;
         }
         else
         {
             CalendarSyncAssistantHelper.Tracer.TraceDebug <object, string, StoreObjectId>((long)this.GetHashCode(), "{0}: CalendarSyncAssistantHelper.ProcessFolder for mailbox {1}: id {2}. Couldn't find a corresponding SynchronizableFolderType object.", TraceContext.Get(), this.GetDisplayName(mailboxSession), folderId);
             calendarSyncFolderOperationLogEntry.FolderType = "UnknownFolderType";
         }
         logEntry.AddFolderDetailLogline(calendarSyncFolderOperationLogEntry);
     }
 }
Esempio n. 6
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);
        }
 // Token: 0x06000802 RID: 2050 RVA: 0x000399AB File Offset: 0x00037BAB
 protected static void Unregister(SynchronizableFolderType folderType)
 {
     SynchronizableFolderType.allSynchronizableFolderTypes.Remove(folderType);
     SynchronizableFolderType.allLists.Remove(folderType.GetType());
 }
Esempio n. 8
0
        // Token: 0x060007E8 RID: 2024 RVA: 0x000395F8 File Offset: 0x000377F8
        private void IncrementOrResetSubscriptionCount(MailboxSession mailboxSession, SynchronizableFolderType folderType, int incrementIfPropertyExists)
        {
            object subscriptionCount = this.GetSubscriptionCount(mailboxSession, folderType, true);
            int    value;

            if (subscriptionCount is PropertyError)
            {
                value = this.GetSynchronizableFolderRows(mailboxSession, folderType.ToList())[folderType].Count;
            }
            else
            {
                value = (int)subscriptionCount + incrementIfPropertyExists;
            }
            this.SetSubscriptionCount(mailboxSession, folderType, value, false);
        }
Esempio n. 9
0
 // Token: 0x060007D8 RID: 2008 RVA: 0x00038DB7 File Offset: 0x00036FB7
 public void DecrementSubscriptionCount(MailboxSession mailboxSession, SynchronizableFolderType folderType)
 {
     this.IncrementOrResetSubscriptionCount(mailboxSession, folderType, -1);
 }