Exemplo n.º 1
0
        public SearchSessionOptionsApplicator(ISearchApi api, SearchSessionOptions options)
        {
            m_Api                 = api;
            m_Options             = options;
            m_Disposed            = false;
            m_CurrentActiveEngine = m_Api?.activeSearchEngineName;

            if (m_Options.legacyOnly)
            {
                m_Api?.SetActiveSearchEngine(LegacySearchEngineBase.k_Name, false);
            }
        }
Exemplo n.º 2
0
 public void EndSession()
 {
     if (!m_WasSearching)
     {
         return;
     }
     m_WasSearching = false;
     using (new SearchSessionOptionsApplicator(m_Api, m_Options))
         m_Api?.EndSession(context);
     context   = null;
     m_Options = SearchSessionOptions.Default;
 }
Exemplo n.º 3
0
 public void BeginSession(Func <ISearchContext> searchContextCreator, SearchSessionOptions options)
 {
     if (m_WasSearching)
     {
         return;
     }
     // Do a lazy initialize if the apis were not available during creation
     if (m_Api == null)
     {
         Init();
         if (m_Api == null)
         {
             throw new NullReferenceException("SearchService Apis were not initialized properly.");
         }
     }
     m_Options      = options;
     context        = searchContextCreator();
     m_WasSearching = true;
     using (new SearchSessionOptionsApplicator(m_Api, options))
         m_Api?.BeginSession(context);
 }
 public FilteredHierarchy(HierarchyType type, SearchService.SearchSessionOptions searchSessionOptions)
 {
     m_HierarchyType        = type;
     m_SearchSessionOptions = searchSessionOptions;
 }
 public FilteredHierarchy(HierarchyType type)
 {
     m_HierarchyType        = type;
     m_SearchSessionOptions = SearchService.SearchSessionOptions.Default;
 }
Exemplo n.º 6
0
 // Called when the filter has changed
 abstract public void UpdateFilter(HierarchyType hierarchyType, SearchFilter searchFilter, bool showFoldersFirst, SearchService.SearchSessionOptions searchSessionOptions);