protected override void UpdateIndex(ICollectionIndexer indexer) { lock (shutdown_mutex) { indexer_running = true; shutdown_requested = false; } bool shutdown_while_indexing = false; if (parent.export_fields != null && parent.export_fields.Count > 0) { indexer.SetExportFields(parent.export_fields.ToArray()); } parent.OnBeginUpdateIndex(); for (int i = 0, models = indexer.GetModelCounts(); i < models; i++) { for (int j = 0, items = indexer.GetModelResultsCount(i); j < items; j++) { if (Shutdown) { shutdown_while_indexing = true; break; } parent.IndexResult(indexer.GetResult(i, j)); } if (shutdown_while_indexing) { break; } } lock (shutdown_mutex) { indexer_running = false; shutdown_requested = false; } if (shutdown_while_indexing) { parent.OnShutdownWhileIndexing(); } parent.OnEndUpdateIndex(); }
protected override void UpdateIndex(ICollectionIndexer indexer) { lock (shutdown_mutex) { indexer_running = true; shutdown_requested = false; } bool shutdown_while_indexing = false; if (parent.export_fields != null && parent.export_fields.Count > 0) { indexer.SetExportFields (parent.export_fields.ToArray ()); } parent.OnBeginUpdateIndex (); for (int i = 0, models = indexer.GetModelCounts (); i < models; i++) { for (int j = 0, items = indexer.GetModelResultsCount (i); j < items; j++) { if (Shutdown) { shutdown_while_indexing = true; break; } parent.IndexResult (indexer.GetResult (i, j)); } if (shutdown_while_indexing) { break; } } lock (shutdown_mutex) { indexer_running = false; shutdown_requested = false; } if (shutdown_while_indexing) { parent.OnShutdownWhileIndexing (); } parent.OnEndUpdateIndex (); }