Exemplo n.º 1
0
 public SearchHighlightDataProvider(TextIndexManager textIndexManager, IEnumerable entries, SimplePropertyProvider provider, string[] lexemes)
 {
     _textIndexManager = textIndexManager;
     _entries          = entries;
     _provider         = provider;
     _lexemes          = lexemes;
 }
Exemplo n.º 2
0
        public void Execute(IActionContext context)
        {
            TextIndexManager timgr = (TextIndexManager)Core.TextIndexManager;

            if (timgr.IsIndexingSuspended)
            {
                timgr.ResumeIndexingByUser();
            }
            else
            {
                timgr.SuspendIndexingByUser();
            }
        }
Exemplo n.º 3
0
        public void  ProcessQuery(string query)
        {
            //-----------------------------------------------------------------
            //  Avoid perform any UI (and other, generally) work if we are
            //  shutting down - some components (like DefaultViewPane) may
            //  already be disposed.
            //-----------------------------------------------------------------
            if (Core.State != CoreState.Running)
            {
                return;
            }

            IResourceList          _resourceListBeforeQuickFind = Core.ResourceBrowser.VisibleResources;
            const string           _captionBeforeQuickFind      = "_caption";
            IHighlightDataProvider highlightDataProvider;
            TextIndexManager       man = (TextIndexManager)Core.TextIndexManager;

            IResourceList searchResults = man.ProcessQuery(query, out highlightDataProvider);

            searchResults = searchResults.Intersect(_resourceListBeforeQuickFind, true);

            string quickFindCaption = query;

            if (!quickFindCaption.StartsWith("\"") || !quickFindCaption.EndsWith("\""))
            {
                quickFindCaption = "'" + quickFindCaption + "'";
            }

            ResourceListDisplayOptions options = new ResourceListDisplayOptions();

            options.Caption = "Search results for " + quickFindCaption + " in " + _captionBeforeQuickFind;
            options.HighlightDataProvider = highlightDataProvider;
            options.SuppressContexts      = true;
            options.ShowNewspaper         = Core.ResourceBrowser.NewspaperVisible;
            IResource ownerView = Core.ResourceBrowser.OwnerResource;

            Core.ResourceBrowser.DisplayResourceList(ownerView, searchResults, options);
            Core.ResourceBrowser.FocusResourceList();
        }
Exemplo n.º 4
0
 public void Execute(IActionContext context)
 {
     foreach (IResourceType resType in Core.ResourceStore.ResourceTypes)
     {
         if (TextIndexManager.IsResTypeIndexingConformant(resType))
         {
             int           count   = 0;
             IResourceList resList = Core.ResourceStore.GetAllResources(resType.Name);
             foreach (int resID in resList.ResourceIds)
             {
                 //  Fix for OM-12527 - illegal resource Ids can be met
                 //  during iteration (negative).
                 if (resID >= 0 && !Core.TextIndexManager.IsDocumentInIndex(resID))
                 {
                     Core.TextIndexManager.QueryIndexing(resID);
                     count++;
                 }
             }
             Trace.WriteLine("-- TextIndexManager -- Finished synchronizing " + count + " of " +
                             resList.ResourceIds.Count + " <" + resType.Name + "> resources.");
         }
     }
 }
Exemplo n.º 5
0
 public SwitchToIdleModeJob(TextIndexManager textIndexManager)
 {
     _textIndexManager = textIndexManager;
 }