private void GotThumbnail(AsyncResult ar) { AsyncResult_Thumbnail result = (AsyncResult_Thumbnail)ar; LevelMetadata level = (LevelMetadata)result.Param; LevelBrowserState state = (LevelBrowserState)level.BrowserState; if (result.Success) { MemoryStream stream = new MemoryStream(result.ThumbnailBytes); level.Thumbnail.Texture = Storage4.TextureLoad(stream); level.Thumbnail.Loading = false; } else { // TODO: Set thumbnail to use missing icon. } if (state.thumbnailCallback != null) { state.thumbnailCallback(level); } state.thumbnailCallback = null; thumbnailLoadOpCount -= 1; }
private void CompleteThumbnail(LevelMetadata level) { level.Thumbnail.Loading = false; if (level.ThumbnailBytes != null) { MemoryStream stream = new MemoryStream(level.ThumbnailBytes); level.Thumbnail.Texture = Storage4.TextureLoad(stream); level.ThumbnailBytes = null; } }