Ejemplo n.º 1
0
        private static async Task LoadTileImageAsync(Tile tile, TileSource tileSource)
        {
            var image = await tileSource.LoadImageAsync(tile.XIndex, tile.Y, tile.ZoomLevel).ConfigureAwait(false);

            if (image != null)
            {
                SetTileImageAsync(tile, image);
            }
        }
Ejemplo n.º 2
0
        private async Task LoadTileImageAsync(TileSource tileSource, Tile tile)
        {
            tile.Pending = false;

            try
            {
                var imageSource = await tileSource.LoadImageAsync(tile.XIndex, tile.Y, tile.ZoomLevel);

                if (imageSource != null)
                {
                    tile.SetImage(imageSource);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("TileImageLoader: {0}/{1}/{2}: {3}", tile.ZoomLevel, tile.XIndex, tile.Y, ex.Message);
            }
        }
Ejemplo n.º 3
0
        private async Task LoadTileImageAsync(Tile tile, TileSource tileSource)
        {
            var tcs = new TaskCompletionSource <object>();

            await tile.Image.Dispatcher.RunAsync(CoreDispatcherPriority.Low, async() =>
            {
                try
                {
                    tile.SetImage(await tileSource.LoadImageAsync(tile.XIndex, tile.Y, tile.ZoomLevel));
                    tcs.SetResult(null);
                }
                catch (Exception ex)
                {
                    tcs.SetException(ex);
                }
            });

            await tcs.Task;
        }
 private static Task LoadTile(Tile tile, TileSource tileSource)
 {
     return(SetTileImage(tile, () => tileSource.LoadImageAsync(tile.XIndex, tile.Y, tile.ZoomLevel)));
 }
Ejemplo n.º 5
0
        private static async Task LoadTileAsync(Tile tile, TileSource tileSource)
        {
            var image = await tileSource.LoadImageAsync(tile.XIndex, tile.Y, tile.ZoomLevel).ConfigureAwait(false);

            await tile.Image.Dispatcher.InvokeAsync(() => tile.SetImage(image));
        }
 private async Task LoadTileImageAsync(Tile tile, TileSource tileSource)
 {
     SetTileImage(tile, await tileSource.LoadImageAsync(tile.XIndex, tile.Y, tile.ZoomLevel));
 }