예제 #1
0
        [SetUp] public void SetUp()
        {
            try
            {
                string[] files = System.IO.Directory.GetFiles(".", "_*");
                foreach (string fileName in files)
                {
                    System.IO.File.Delete(fileName);
                }
            }
            catch (Exception exc)
            {
                Assert.Fail(exc.Message);
            }

            OMEnv.DataDir = ".\\Data";
            InitStorage();
            for (int i = 0; i < _processors.Length; ++i)
            {
                _processors[i] = new AsyncProcessor(new AsyncExceptionHandler(ExceptionHandler), false);
            }

            MockPluginEnvironment env = new MockPluginEnvironment(_storage);

            env.SetCoreProps(new MockCoreProps());

            indexer = new FullTextIndexer();
            indexer.Initialize();
            Core.ResourceStore.ResourceTypes.Register("TestType", "TestType", "Name", ResourceTypeFlags.Normal);
        }
예제 #2
0
 private void TextIndexProcessor_ThreadStarted(object sender, EventArgs e)
 {
     _queryManager = new TextQueriesOptimizationManager(this, _textIndexer);
     _textIndexer.Initialize();
     if (!IsIndexPresent())
     {
         if (!IdleIndexingMode)
         {
             RebuildIndexImpl();
         }
     }
     else
     {
         FixUnindexedResources();
     }
     ThreadStarted -= TextIndexProcessor_ThreadStarted;
     ThreadPriority = System.Threading.ThreadPriority.Lowest;
     Trace.WriteLine("-- TextIndexManager -- Thread started.");
 }