Esempio n. 1
0
 private static void ApplySearchFolderCriteria(IXSOFactory xsoFactory, IMailboxSession mailboxSession, ISearchFolder searchFolder, SearchFolderCriteria searchFolderCriteria, Action <SearchFolderCriteria> applySearchCriteriaAction)
 {
     ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory);
     ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession);
     ArgumentValidator.ThrowIfNull("searchFolder", searchFolder);
     ArgumentValidator.ThrowIfNull("searchFolderCriteria", searchFolderCriteria);
     ContactsSearchFolderCriteria.Tracer.TraceDebug <SearchFolderCriteria>((long)mailboxSession.GetHashCode(), "Applying search folder criteria: {0}", searchFolderCriteria);
     try
     {
         applySearchCriteriaAction(searchFolderCriteria);
     }
     catch (ObjectNotFoundException)
     {
         List <StoreObjectId> list = new List <StoreObjectId>(searchFolderCriteria.FolderScope.Length);
         foreach (StoreId storeId in searchFolderCriteria.FolderScope)
         {
             list.Add((StoreObjectId)storeId);
         }
         searchFolderCriteria.FolderScope = ContactsSearchFolderCriteria.RemoveDeletedFoldersFromCollection(xsoFactory, mailboxSession, list);
         applySearchCriteriaAction(searchFolderCriteria);
     }
 }
Esempio n. 2
0
 private void SetFolderIds(IFolder rootFolder, StoreObjectId[] newFolderIds)
 {
     newFolderIds = ContactsSearchFolderCriteria.RemoveDeletedFoldersFromCollection(this.xsoFactory, this.mailboxSession, newFolderIds);
     ContactsSearchFolderCriteria.MyContacts.UpdateFolderScope(this.xsoFactory, this.mailboxSession, newFolderIds);
     ContactsSearchFolderCriteria.MyContactsExtended.UpdateFolderScope(this.xsoFactory, this.mailboxSession, ContactsSearchFolderCriteria.GetMyContactExtendedFolders(this.mailboxSession, newFolderIds, true));
 }