/// <summary> /// Start ImageBooster thread /// </summary> public async void StartImageBooster() { while (this.IsRunWorker) { if (this.QueuedList.Count > 0) { // pop out the first item var index = this.QueuedList[0]; var img = this.ImgList[index]; QueuedList.RemoveAt(0); if (!img.IsDone) { // start loading image file await img.LoadAsync( size : this.ImgSize, colorProfileName : this.ColorProfileName, isApplyColorProfileForAll : this.IsApplyColorProfileForAll, channel : this.Channels, useEmbeddedThumbnail : this.UseEmbeddedThumbnail ); } } await Task.Delay(10); } }
/// <summary> /// Start ImageBooster thread /// </summary> public async Task StartImageBoosterAsync() { while (IsRunWorker) { if (QueuedList.Count > 0) { // pop out the first item var index = QueuedList[0]; var img = ImgList[index]; QueuedList.RemoveAt(0); if (!img.IsDone) { // start loading image file await img.LoadAsync( size : ImgSize, colorProfileName : ColorProfileName, isApplyColorProfileForAll : IsApplyColorProfileForAll, channel : Channels, useEmbeddedThumbnail : UseEmbeddedThumbnail ).ConfigureAwait(true); } } await Task.Delay(10).ConfigureAwait(true); } }