コード例 #1
0
        public SearchCoordinator(TweetHuntViewModel viewModel,
                                 SearchConfiguration configuration)
        {
            _model = viewModel;
            _timer = configuration.Timer;
            _searchService = configuration.SearchService;
            
            _model.SearchItems.CollectionChanged += SearchItemsCollectionChanged;
            _timer.Tick += (s, e) => InitiateSearch();
            _searchService.SearchComplete += SearchComplete;

            _minSecondsBetweenItemSearch = configuration.MinSecondsBetweenItemSearch;            
        }
コード例 #2
0
 public virtual void Setup()
 {
     SystemTime.Now = () => _now;
     _searchService = new FakeTwitterSearchService();
     _timer = new FakeSearchTimer();
     var configuration = new SearchConfiguration()
     {
         MinSecondsBetweenItemSearch = 300,
         MaxSearchResults = _maxSearchResults,
         SearchService = _searchService,
         Timer = _timer
     };
     _model = new TweetHuntViewModel(configuration);
 }
コード例 #3
0
 public TweetHuntViewModel(SearchConfiguration configuration)
 {
     _searchItems   = new SearchItemCollection();
     _searchResults = new SearchResultCollection(configuration.MaxSearchResults);
     _coordinator   = new SearchCoordinator(this, configuration);
 }
コード例 #4
0
 public TweetHuntViewModel(SearchConfiguration configuration)
 {
     _searchItems = new SearchItemCollection();
     _searchResults  = new SearchResultCollection(configuration.MaxSearchResults);
     _coordinator = new SearchCoordinator(this, configuration);
 }