Ejemplo n.º 1
0
 public void Search5(string text)
 {
     Bing.BingService   bingClient = new Bing.BingService();
     Bing.SearchRequest request    = new Bing.SearchRequest();
     request.AppId   = BING_API_ID;
     request.Sources = new LMT92.Bing.SourceType[] { Bing.SourceType.Web };
     request.Query   = text;
     bingClient.BeginSearch(request, new AsyncCallback(BingAsyncCallback), bingClient);
 }
Ejemplo n.º 2
0
        void BingAsyncCallback(IAsyncResult ar)
        {
            Bing.BingService    client   = ar.AsyncState as Bing.BingService;
            Bing.SearchResponse response = client.EndSearch(ar);
            var results = response.Web.Results.Select(wr => new SearchResultItem {
                Title = wr.Title
            }).ToList();

            if (_sync != null)
            {
                _sync(results);
            }
        }
 public void Search5 (string text)
 {
     Bing.BingService bingClient = new Bing.BingService ();
     Bing.SearchRequest request = new Bing.SearchRequest ();
     request.AppId = BING_API_ID;
     request.Sources = new LMT92.Bing.SourceType[] { Bing.SourceType.Web };
     request.Query = text;
     bingClient.BeginSearch (request, new AsyncCallback (BingAsyncCallback), bingClient);
 }