internal virtual ISearchFolder CreateISearchFolder() { // TODO: Instantiate an appropriate concrete class. ISearchFolder target = null; return(target); }
public void MessageCountTest() { ISearchFolder target = CreateISearchFolder(); // TODO: Initialize to an appropriate value int actual; actual = target.MessageCount; Assert.Inconclusive("Verify the correctness of this test method."); }
public void NameTest() { ISearchFolder target = CreateISearchFolder(); // TODO: Initialize to an appropriate value string actual; actual = target.Name; Assert.Inconclusive("Verify the correctness of this test method."); }
public void DatabaseContextTest() { ISearchFolder target = CreateISearchFolder(); // TODO: Initialize to an appropriate value IDBAccessor actual; actual = target.DatabaseContext; Assert.Inconclusive("Verify the correctness of this test method."); }
public void OpenSearchFolderTest() { IPst target = CreateIPst(); // TODO: Initialize to an appropriate value NodeID nodeID = new NodeID(); // TODO: Initialize to an appropriate value ISearchFolder expected = null; // TODO: Initialize to an appropriate value ISearchFolder actual; actual = target.OpenSearchFolder(nodeID); Assert.AreEqual(expected, actual); Assert.Inconclusive("Verify the correctness of this test method."); }
public void UpdateFolderScope(IXSOFactory xsoFactory, IMailboxSession mailboxSession, StoreObjectId[] scope) { ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory); ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession); ArgumentValidator.ThrowIfNull("scope", scope); StoreObjectId defaultFolderId = mailboxSession.GetDefaultFolderId(this.defaultFolderType); if (defaultFolderId == null) { mailboxSession.CreateDefaultFolder(this.defaultFolderType); defaultFolderId = mailboxSession.GetDefaultFolderId(this.defaultFolderType); } using (ISearchFolder searchFolder = xsoFactory.BindToSearchFolder(mailboxSession, defaultFolderId)) { ContactsSearchFolderCriteria.UpdateFolderScope(xsoFactory, mailboxSession, searchFolder, scope); } }
private StoreObjectId[] GetFolderIdsFromSearchFolder(DefaultFolderType searchFolderId) { SearchFolderCriteria searchFolderCriteria = null; try { using (ISearchFolder searchFolder = this.xsoFactory.BindToSearchFolder(this.mailboxSession, searchFolderId)) { searchFolderCriteria = searchFolder.GetSearchCriteria(); } } catch (ObjectNotInitializedException arg) { MyContactFolders.Tracer.TraceError <DefaultFolderType, ObjectNotInitializedException>((long)this.GetHashCode(), "Unable to load folder ids from the search folder {0} due ObjectNotInitializedException: {1}", searchFolderId, arg); return(null); } catch (ObjectNotFoundException arg2) { MyContactFolders.Tracer.TraceError <DefaultFolderType, ObjectNotFoundException>((long)this.GetHashCode(), "Unable to load folder ids from the search folder {0} due ObjectNotFoundException: {1}", searchFolderId, arg2); return(null); } if (searchFolderCriteria == null) { MyContactFolders.Tracer.TraceError <DefaultFolderType>((long)this.GetHashCode(), "There is no search folder criteria in the search folder {0}", searchFolderId); return(null); } if (searchFolderCriteria.FolderScope == null) { MyContactFolders.Tracer.TraceError <DefaultFolderType>((long)this.GetHashCode(), "There is no folder scope in the search folder {0}", searchFolderId); return(null); } if (searchFolderCriteria.FolderScope.Length == 0) { MyContactFolders.Tracer.TraceError <DefaultFolderType>((long)this.GetHashCode(), "The folder scope in the search folder {0} is empty", searchFolderId); return(null); } StoreObjectId[] array = new StoreObjectId[searchFolderCriteria.FolderScope.Length]; for (int i = 0; i < searchFolderCriteria.FolderScope.Length; i++) { array[i] = (StoreObjectId)searchFolderCriteria.FolderScope[i]; } MyContactFolders.Tracer.TraceDebug <DefaultFolderType, ArrayTracer <StoreObjectId> >((long)this.GetHashCode(), "Loaded folder ids from the scope of search folder {0}: {1}", searchFolderId, new ArrayTracer <StoreObjectId>(array)); return(array); }
public SelectFolderCommand(ISearchFolder searchFolderProvider, ISearchFolderChanger searchFolderChanger) { SearchFolderChanger = searchFolderChanger; SearchFolderProvider = searchFolderProvider; }
public SearchCommand(ISearchFolder searchFolderProvider, ISearchArguments searchArgumentsProvider) { SearchFolderProvider = searchFolderProvider; SearchArgumentsProvider = searchArgumentsProvider; }
public SearchApplication(IApplicationCommandController controller, ISearchFolder searchFolderProvider, ISearchArguments searchArgumentsProvider, ISearchFolderChanger searchFolderChanger) { Controller = controller; Controller.AddCommand(new SelectFolderCommand(searchFolderProvider, searchFolderChanger), true); Controller.AddCommand(new SearchCommand(searchFolderProvider, searchArgumentsProvider), true); }
public static void UpdateFolderScope(IXSOFactory xsoFactory, IMailboxSession mailboxSession, ISearchFolder searchFolder, StoreObjectId[] folderScope) { ArgumentValidator.ThrowIfNull("xsoFactory", xsoFactory); ArgumentValidator.ThrowIfNull("mailboxSession", mailboxSession); ArgumentValidator.ThrowIfNull("searchFolder", searchFolder); ArgumentValidator.ThrowIfNull("folderScope", folderScope); SearchFolderCriteria searchFolderCriteria; try { searchFolderCriteria = searchFolder.GetSearchCriteria(); } catch (ObjectNotInitializedException) { searchFolderCriteria = null; } if (searchFolderCriteria != null && ContactsSearchFolderCriteria.MatchFolderScope(searchFolderCriteria.FolderScope, folderScope)) { return; } SearchFolderCriteria searchFolderCriteria2 = ContactsSearchFolderCriteria.CreateSearchCriteria(folderScope); ContactsSearchFolderCriteria.Tracer.TraceDebug <SearchFolderCriteria, SearchFolderCriteria>((long)searchFolder.GetHashCode(), "Updating MyContactsFolder Search Criteria since it is different from the current one. Current:{0}, New:{1}.", searchFolderCriteria, searchFolderCriteria2); ContactsSearchFolderCriteria.ApplyContinuousSearchFolderCriteria(xsoFactory, mailboxSession, searchFolder, searchFolderCriteria2); ContactsSearchFolderCriteria.WaitForSearchFolderPopulation(xsoFactory, mailboxSession, searchFolder); }
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); } }
public static void WaitForSearchFolderPopulation(IXSOFactory xsoFactory, IMailboxSession mailboxSession, ISearchFolder searchFolder) { if (ContactsSearchFolderCriteria.IsSearchFolderPopulated(searchFolder)) { ContactsSearchFolderCriteria.Tracer.TraceDebug((long)mailboxSession.GetHashCode(), "Search folder is already populated. No wait required."); return; } ContactsSearchFolderCriteria.Tracer.TraceDebug((long)mailboxSession.GetHashCode(), "Waiting for search folder to complete current population."); searchFolder.Load(); using (SearchFolderAsyncSearch searchFolderAsyncSearch = new SearchFolderAsyncSearch((MailboxSession)mailboxSession, searchFolder.Id.ObjectId, null, null)) { if (ContactsSearchFolderCriteria.IsSearchFolderPopulated(searchFolder)) { ContactsSearchFolderCriteria.Tracer.TraceDebug((long)mailboxSession.GetHashCode(), "Search folder population completed."); } else { bool arg = searchFolderAsyncSearch.AsyncResult.AsyncWaitHandle.WaitOne(ContactsSearchFolderCriteria.SearchInProgressTimeout); ContactsSearchFolderCriteria.Tracer.TraceDebug <bool>((long)mailboxSession.GetHashCode(), "Done waiting, search folder population completed: {0}.", arg); } } }
private static bool IsSearchFolderPopulated(ISearchFolder folder) { SearchFolderCriteria searchCriteria = folder.GetSearchCriteria(); return((searchCriteria.SearchState & SearchState.Rebuild) != SearchState.Rebuild); }
public static void ApplyContinuousSearchFolderCriteria(IXSOFactory xsoFactory, IMailboxSession mailboxSession, ISearchFolder searchFolder, SearchFolderCriteria searchFolderCriteria) { ContactsSearchFolderCriteria.ApplySearchFolderCriteria(xsoFactory, mailboxSession, searchFolder, searchFolderCriteria, new Action <SearchFolderCriteria>(searchFolder.ApplyContinuousSearch)); }