예제 #1
0
 protected override IObservable <TwitterStatus> Fetch(long?maxId, int?count)
 {
     if (_option == SearchOption.Web)
     {
         var acc = Setting.Accounts.GetRandomOne();
         if (acc == null)
         {
             return(Observable.Empty <TwitterStatus>());
         }
         System.Diagnostics.Debug.WriteLine("SEARCHPANE SEARCH QUERY: " + _query);
         var param = new SearchParameter(_query, maxId: maxId, count: count,
                                         lang: String.IsNullOrWhiteSpace(Setting.SearchLanguage.Value)
                 ? null
                 : Setting.SearchLanguage.Value,
                                         locale: String.IsNullOrWhiteSpace(Setting.SearchLocale.Value)
                 ? null
                 : Setting.SearchLocale.Value);
         return(acc.CreateAccessor()
                .SearchAsync(param, CancellationToken.None)
                .ToObservable()
                .SelectMany(s => s.Result)
                .Do(StatusInbox.Enqueue));
     }
     return(StatusProxy.FetchStatuses(_filterFunc, _filterSql, maxId, count)
            .ToObservable()
            .SelectMany(s => s)
            .Merge(_filterQuery != null
                           ? _filterQuery.ReceiveSources(maxId)
                           : Observable.Empty <TwitterStatus>()));
 }
예제 #2
0
 protected override IObservable <TwitterStatus> Fetch(long?maxId, int?count)
 {
     return(StatusProxy.FetchStatuses(this._filterFunc, this._filterSql, maxId, count)
            .Merge(_filterQuery != null
                           ? _filterQuery.ReceiveSources(maxId)
                           : Observable.Empty <TwitterStatus>()));
 }