NSUrlDownloadSessionResponse GetCompletionHandler(NSUrlSessionResponse completionHandler) { if (completionHandler == null) return null; // we can't return an NSData so we return null - just in case existing code did not use it (e.g. only error) return delegate (NSUrl location, NSUrlResponse response, NSError error) { completionHandler (null, response, error); }; }
NSUrlDownloadSessionResponse GetCompletionHandler(NSUrlSessionResponse completionHandler) { if (completionHandler == null) { return(null); } // we can't return an NSData so we return null - just in case existing code did not use it (e.g. only error) return(delegate(NSUrl location, NSUrlResponse response, NSError error) { completionHandler(null, response, error); }); }
public override NSUrlSessionUploadTask CreateUploadTask(NSUrlRequest request, NSUrl fileURL, NSUrlSessionResponse completionHandler) { throw new NotSupportedException("NS_UNAVAILABLE"); }
public override NSUrlSessionDataTask CreateDataTask(NSUrl url, NSUrlSessionResponse completionHandler) { throw new NotSupportedException("NS_UNAVAILABLE"); }
public override NSUrlSessionUploadTask CreateUploadTask(NSUrlRequest request, NSData bodyData, NSUrlSessionResponse completionHandler) { throw new NotImplementedException(); }
public override NSUrlSessionDataTask CreateDataTask(NSUrl url, NSUrlSessionResponse completionHandler) { throw new NotImplementedException(); }
public virtual NSUrlSessionDownloadTask CreateDownloadTaskFromResumeData(NSData resumeData, NSUrlSessionResponse completionHandler) { return(CreateDownloadTaskFromResumeData(resumeData, GetCompletionHandler(completionHandler))); }
public virtual NSUrlSessionDownloadTask CreateDownloadTask(NSUrl url, NSUrlSessionResponse completionHandler) { return(CreateDownloadTask(url, GetCompletionHandler(completionHandler))); }
public override NSUrlSessionDataTask CreateDataTask(NSUrl url, NSUrlSessionResponse completionHandler) { throw new NotSupportedException ("NS_UNAVAILABLE"); }
public override NSUrlSessionUploadTask CreateUploadTask(NSUrlRequest request, NSData bodyData, NSUrlSessionResponse completionHandler) { throw new NotSupportedException ("NS_UNAVAILABLE"); }
public virtual NSUrlSessionDownloadTask CreateDownloadTaskFromResumeData(NSData resumeData, NSUrlSessionResponse completionHandler) { return CreateDownloadTaskFromResumeData (resumeData, GetCompletionHandler (completionHandler)); }
public virtual NSUrlSessionDownloadTask CreateDownloadTask(NSUrl url, NSUrlSessionResponse completionHandler) { return CreateDownloadTask (url, GetCompletionHandler (completionHandler)); }