示例#1
0
 public void OnQueryResultItemReady(IQueryResultItem item)
 {
     List<Pipe> newPipes =
         _queryResultItemSubscriberManager.NotifyAll(item);
     // Assert(newPipes != null)
     lock (_queryResultItemPipes)
     {
         _queryResultItemPipes.AddRange(newPipes);
     }
 }
 private void OnSearchResultDone( IQueryResultItem result, InputQuery query )
 {
     if (query == _result.Query)
     {
         lock (_result)
         {
             switch (result.ResultType)
             {
                 case QueryResultItemType.SearchEngineResult:
                     _result.SearchEngineResultItems.Add( result as SearchEngineResult );
                     break;
                 case QueryResultItemType.DictionaryResult:
                     _result.DictResultItems.Add(result as DictResult);
                     break;
                 case QueryResultItemType.SuggestionResult:
                     _result.SuggestionResultItems.Add(result as SuggestionResult);
                     break;
                 default:
                     break;
             }
             _result.LastUpdateTime = DateTime.Now;
             _handler.OnResultUpdate(_result);
             _pipeline.OnQueryResultReady(_result);
             if ( (_result.SearchEngineResultItems.Count +
                 _result.SuggestionResultItems.Count +
                 _result.DictResultItems.Count)
                 == _searchEngineList.Count)
             {
                 _handler.OnResultCompleted(_result);
                 //_pipeline.OnQueryResultReady(_result);
             }
         }
     }
 }
示例#3
0
 public void OnQueryResultItemCanceled(IQueryResultItem item)
 {
     lock (_queryResultItemPipes)
     {
         foreach (Pipe pipe in _queryResultItemPipes)
         {
             if (pipe.Message == item)
             {
                 pipe.CancelMessage();
             }
         }
     }
 }