public SDWebImageOperation Download(string url, SDWebImageOptions options, SDWebImageDownloaderProgressBlock progress, SDWebImageCompletedWithFinishedBlock completed) { // TEMP - remove after Xamarin.iOS update (7.0.2 or whatever) #if DEBUG completed(new UIImage(), null, 0, true); return(null); #endif if (!Uri.IsWellFormedUriString(url, UriKind.Absolute)) { throw new Exception(String.Format("Malformed url: {0}", url)); } return(Download(NSUrl.FromString(url), options, progress, completed)); }
public static void SetImage(this UIImageView view, string url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, SDWebImageCompletedBlock completed = null) { if (!Uri.IsWellFormedUriString(url, UriKind.Absolute)) { return; } SDWebImageManager.SharedManager.SetImage(view, NSUrl.FromString(url), placeholder, options, progress, completed); }
public static void SetImage(this UIImageView view, NSUrl url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, SDWebImageCompletedBlock completed = null) { SDWebImageManager.SharedManager.SetImage(view, url, placeholder, options, progress, completed); }
public Task <ImageDownloadResult> DownloadAsync(string url, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, CancellationToken token = default(CancellationToken)) { if (!Uri.IsWellFormedUriString(url, UriKind.Absolute)) { throw new Exception(String.Format("Malformed url: {0}", url)); } return(DownloadAsync(NSUrl.FromString(url), options, progress, token)); }
public Task <ImageDownloadResult> DownloadAsync(NSUrl url, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, CancellationToken token = default(CancellationToken)) { var tcs = new TaskCompletionSource <ImageDownloadResult> (); SDWebImageOperation operation = null; operation = Download(url, options, progress, (image, error, cacheType, finished) => { if (token.IsCancellationRequested) { operation.Cancel(); tcs.TrySetCanceled(); return; } if (finished) { if (image == null) { tcs.TrySetException(new NSErrorException(error)); return; } tcs.TrySetResult(new ImageDownloadResult(image, cacheType)); } }); return(tcs.Task); }
public static Task <ImageDownloadResult> SetImageAsync(this UIImageView view, NSUrl url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null) { var tcs = new TaskCompletionSource <ImageDownloadResult> (); SDWebImageManager.SharedManager.SetImage(view, url, placeholder, options, progress, (image, error, cacheType) => { if (image == null) { tcs.SetException(new NSErrorException(error)); return; } tcs.SetResult(new ImageDownloadResult(image, cacheType)); }); return(tcs.Task); }
public static Task <ImageDownloadResult> SetImageAsync(this UIImageView view, string url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null) { if (!Uri.IsWellFormedUriString(url, UriKind.Absolute)) { throw new Exception(String.Format("Malformed url: {0}", url)); } return(SetImageAsync(view, NSUrl.FromString(url), placeholder, options, progress)); }
public static void SetImage(this UIImageView view, string url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, SDWebImageCompletedBlock completed = null) { if (!Uri.IsWellFormedUriString (url, UriKind.Absolute)) return; SDWebImageManager.SharedManager.SetImage (view, NSUrl.FromString (url), placeholder, options, progress, completed); }
public static Task<ImageDownloadResult> SetImageAsync(this UIImageView view, NSUrl url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null) { var tcs = new TaskCompletionSource<ImageDownloadResult> (); SDWebImageManager.SharedManager.SetImage (view, url, placeholder, options, progress, (image, error, cacheType) => { if (image == null) { tcs.SetException (new NSErrorException (error)); return; } tcs.SetResult (new ImageDownloadResult (image, cacheType)); }); return tcs.Task; }
public static void SetImage(this UIImageView view, NSUrl url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, SDWebImageCompletedBlock completed = null) { SDWebImageManager.SharedManager.SetImage (view, url, placeholder, options, progress, completed); }
public Task<ImageDownloadResult> DownloadAsync(string url, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, CancellationToken token = default(CancellationToken)) { if (!Uri.IsWellFormedUriString (url, UriKind.Absolute)) throw new Exception (String.Format ("Malformed url: {0}", url)); return DownloadAsync (NSUrl.FromString (url), options, progress, token); }
public Task<ImageDownloadResult> DownloadAsync(NSUrl url, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null, CancellationToken token = default(CancellationToken)) { var tcs = new TaskCompletionSource<ImageDownloadResult> (); SDWebImageOperation operation = null; operation = Download (url, options, progress, (image, error, cacheType, finished) => { if (token.IsCancellationRequested) { operation.Cancel (); tcs.TrySetCanceled (); return; } if (finished) { if (image == null) { tcs.TrySetException (new NSErrorException (error)); return; } tcs.TrySetResult (new ImageDownloadResult (image, cacheType)); } }); return tcs.Task; }
public SDWebImageOperation Download(string url, SDWebImageOptions options, SDWebImageDownloaderProgressBlock progress, SDWebImageCompletedWithFinishedBlock completed) { // TEMP - remove after Xamarin.iOS update (7.0.2 or whatever) #if DEBUG completed (new UIImage(), null, 0, true); return null; #endif if (!Uri.IsWellFormedUriString (url, UriKind.Absolute)) throw new Exception (String.Format ("Malformed url: {0}", url)); return Download (NSUrl.FromString (url), options, progress, completed); }
public static Task<ImageDownloadResult> SetImageAsync(this UIImageView view, string url, UIImage placeholder = null, SDWebImageOptions options = SDWebImageOptions.None, SDWebImageDownloaderProgressBlock progress = null) { if (!Uri.IsWellFormedUriString (url, UriKind.Absolute)) throw new Exception (String.Format ("Malformed url: {0}", url)); return SetImageAsync (view, NSUrl.FromString (url), placeholder, options, progress); }