Beispiel #1
0
        private void ProcessFolderCountAdvisor(OwaFolderCountAdvisor folderCountAdvisor)
        {
            if (folderCountAdvisor == null)
            {
                throw new ArgumentNullException("folderCountAdvisor");
            }
            MailboxSession mailboxSession = null;

            if (folderCountAdvisor.FolderId == null)
            {
                if (!folderCountAdvisor.MailboxOwner.MailboxInfo.IsAggregated)
                {
                    mailboxSession = base.UserContext.MailboxSession;
                }
                else
                {
                    mailboxSession = base.UserContext.GetArchiveMailboxSession(folderCountAdvisor.MailboxOwner);
                }
            }
            else
            {
                try
                {
                    mailboxSession = (folderCountAdvisor.FolderId.GetSession(base.UserContext) as MailboxSession);
                }
                catch (ObjectNotFoundException)
                {
                    return;
                }
            }
            if (mailboxSession != null)
            {
                Dictionary <StoreObjectId, ItemCountPair> itemCounts = folderCountAdvisor.GetItemCounts(mailboxSession);
                if (itemCounts == null)
                {
                    return;
                }
                IDictionaryEnumerator dictionaryEnumerator = itemCounts.GetEnumerator();
                while (dictionaryEnumerator.MoveNext())
                {
                    ItemCountPair countPair = (ItemCountPair)dictionaryEnumerator.Value;
                    if (countPair.ItemCount != -1L || countPair.UnreadItemCount != -1L)
                    {
                        OwaStoreObjectId owaStoreObjectId = OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, (StoreObjectId)dictionaryEnumerator.Key);
                        this.RenderUpdateCountJavascript(owaStoreObjectId, countPair);
                        if (owaStoreObjectId.StoreObjectType == StoreObjectType.Folder)
                        {
                            StoreObjectId folderId = StoreObjectId.FromProviderSpecificId(owaStoreObjectId.StoreObjectId.ProviderLevelItemId, StoreObjectType.OutlookSearchFolder);
                            this.RenderUpdateCountJavascript(OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, folderId), countPair);
                            StoreObjectId folderId2 = StoreObjectId.FromProviderSpecificId(owaStoreObjectId.StoreObjectId.ProviderLevelItemId, StoreObjectType.SearchFolder);
                            this.RenderUpdateCountJavascript(OwaStoreObjectId.CreateFromSessionFolderId(base.UserContext, mailboxSession, folderId2), countPair);
                        }
                    }
                }
                return;
            }
        }
		// Token: 0x06002EC0 RID: 11968 RVA: 0x0010C7F8 File Offset: 0x0010A9F8
		private void ProcessOwaFolderCountAdvisor()
		{
			OwaFolderCountAdvisor folderCountAdvisor = base.UserContext.NotificationManager.FolderCountAdvisor;
			if (folderCountAdvisor != null)
			{
				this.ProcessFolderCountAdvisor(folderCountAdvisor);
			}
			if (base.UserContext.NotificationManager.ArchiveFolderCountAdvisorTable != null)
			{
				this.ProcessArchiveOwaFolderCountAdvisor();
			}
			if (base.UserContext.NotificationManager.DelegateFolderCountAdvisorTable != null)
			{
				this.ProcessDelegateOwaFolderCountAdvisor();
			}
		}