public void Cancel(ArtworkGrid artworkGrid) { lock (SyncRoot) { this.Queue.Remove(artworkGrid); } }
public Task Load(ArtworkGrid artworkGrid) { lock (SyncRoot) { this.Queue.Add(artworkGrid); } return(this.Factory.StartNew(() => { lock (SyncRoot) { if (!this.Queue.Contains(artworkGrid)) { #if NET40 return TaskEx.FromResult(false); #else return Task.CompletedTask; #endif } } return artworkGrid.Refresh(); })); }