private void AttemptToRestoreFolderCountAdvisor(MailboxSession mailboxSession) { ItemCountAdvisor itemCountAdvisor = ItemCountAdvisor.Create(mailboxSession, this.eventCondition); this.countAdvisor.Dispose(); this.countAdvisor = itemCountAdvisor; }
internal OwaFolderCountAdvisor(MailboxSession mailboxSession, OwaStoreObjectId folderId, EventObjectType objectType, EventType eventType) { this.folderId = folderId; this.mailboxOwner = mailboxSession.MailboxOwner; this.eventCondition = new EventCondition(); this.eventCondition.EventType = eventType; this.eventCondition.ObjectType = objectType; if (folderId != null) { this.eventCondition.ContainerFolderIds.Add(folderId.StoreObjectId); if (mailboxSession.LogonType == LogonType.Delegated) { this.eventCondition.ObjectIds.Add(folderId.StoreObjectId); } } this.countAdvisor = ItemCountAdvisor.Create(mailboxSession, this.eventCondition); }