public static WebFile FromUrlUntracked(Uri url, HttpResponseMessage partialResponse, bool continueDownload) { var existing = new WebFile(url); existing.SaveResponseInfo(partialResponse, continueDownload); return(existing); }
protected static void Initialize(WebFile existing, WebFile typed, HttpResponseMessage partialResponse, bool continueDownload) { typed.SaveResponseInfo(partialResponse, continueDownload); if (existing != null && !object.ReferenceEquals(typed, existing)) { typed.Size = existing.Size; typed.contentDispositionFileName = existing.contentDispositionFileName; typed.contentTypeExtension = existing.contentTypeExtension; lock (existing) { lock (typed) { if (existing.manager != null && (typed.manager == null || !typed.manager.IsAlive)) { existing.manager = typed.manager; } } } } }
protected static void Initialize(WebFile existing, WebFile typed, HttpResponseMessage partialResponse, bool continueDownload) { typed.SaveResponseInfo(partialResponse, continueDownload); if (existing != null && !object.ReferenceEquals(typed, existing)) { typed.Size = existing.Size; typed.contentDispositionFileName = existing.contentDispositionFileName; typed.contentTypeExtension = existing.contentTypeExtension; lock (existing) { lock (typed) { if (existing.manager != null && (typed.manager == null || !typed.manager.IsAlive)) { existing.manager = typed.manager; } } } } }
public static WebFile FromUrlUntracked(Uri url, HttpResponseMessage partialResponse, bool continueDownload) { var existing = new WebFile(url); existing.SaveResponseInfo(partialResponse, continueDownload); return existing; }