Exemplo n.º 1
0
        public SearchResult(
            ISearchManagerInternal owner,
            SearchAllOptions options,
            IFilter optionsFilter,
            IList <ILogSourceSearchWorkerInternal> workers,
            Progress.IProgressAggregatorFactory progressAggregatorFactory,
            ISynchronizationContext modelSynchronization,
            Settings.IGlobalSettingsAccessor settings,
            int id,
            ISearchObjectsFactory factory,
            ITraceSourceFactory traceSourceFactory
            )
        {
            this.owner                = owner;
            this.options              = options;
            this.optionsFilter        = optionsFilter;
            this.factory              = factory;
            this.modelSynchronization = modelSynchronization;
            this.id                     = id;
            this.cancellation           = new CancellationTokenSource();
            this.results                = new List <ISourceSearchResultInternal>();
            this.progressAggregator     = progressAggregatorFactory.CreateProgressAggregator();
            this.updateInvokationHelper = new AsyncInvokeHelper(modelSynchronization, UpdateStatus);
            this.hitsLimit              = settings.MaxNumberOfHitsInSearchResultsView;
            this.visible                = true;
            this.trace                  = traceSourceFactory.CreateTraceSource("SearchManager", "sr." + id.ToString());
            this.timeGapsDetector       = new TimeGapsDetector(trace, modelSynchronization, this, traceSourceFactory);

            this.timeGapsDetector.OnTimeGapsChanged += (s, e) =>
            {
                owner.OnResultChanged(this, SearchResultChangeFlag.TimeGapsChanged);
            };

            this.progressAggregator.ProgressChanged += HandleProgressChanged;

            this.searchTime = Stopwatch.StartNew();
            this.results.AddRange(workers.Select(w => factory.CreateSourceSearchResults(w, this, cancellation.Token, progressAggregator)));
            if (results.Count == 0)
            {
                status = SearchResultStatus.Finished;
                HandleFinalStateTransition();
            }
        }
Exemplo n.º 2
0
 void ISearchResultInternal.OnResultChanged(ISourceSearchResultInternal rslt)
 {
     owner.OnResultChanged(this, SearchResultChangeFlag.HitCountChanged);
 }