コード例 #1
0
ファイル: PhotoDownloadQueue.cs プロジェクト: telemat/Demo
        private void OnSearch(SearchPhotoEvent searchPhotoEvent)
        {
            if (_currentSearchRequestId != searchPhotoEvent.SearchId)
            {
                // remember the search that is in progress
                _currentSearchRequestId = searchPhotoEvent.SearchId;

                //
                // flush photos from previous search
                //

                //PhotoViewModel vm;
                //do
                //{
                //    vm = null;
                //    _queuePhotoViewModels.TryDequeue(out vm);
                //} while (vm != null);
            }
        }
コード例 #2
0
ファイル: PhotoDownloaderTask.cs プロジェクト: telemat/Demo
        private void OnSearchPhoto(SearchPhotoEvent searchPhotoEvent)
        {
            // update the search request if it is a new one
            if (_searchRequest.SearchRequestId != searchPhotoEvent.SearchId)
            {
                lock (_searchRequest.SynLock)
                {
                    _searchRequest.SearchRequestId = searchPhotoEvent.SearchId;
                    _searchRequest.SearchTerm = searchPhotoEvent.SearchTerm;
                    _searchRequest.IsUpdated = true;
                }
            }

            if (! IsRunning)
                Resume();
        }