private void CancelPendingRequest() { if (_pendingRequest == null) { return; } Loader.Cancel(_pendingRequest); _pendingRequest = null; }
public void Cancel(LoadThumbnailRequest request) { lock (_syncLock) { while (true) { if (!_pendingRequests.Remove(request)) { break; } } } }
public void LoadThumbnailAsync(LoadThumbnailRequest request) { lock (_syncLock) { _pendingRequests.Add(request); if (_isLoading) { return; } _isLoading = true; ThreadPool.QueueUserWorkItem(Load, null); } }