Ejemplo n.º 1
0
        public static WebFile FromUrlUntracked(Uri url, HttpResponseMessage partialResponse, bool continueDownload)
        {
            var existing = new WebFile(url);

            existing.SaveResponseInfo(partialResponse, continueDownload);
            return(existing);
        }
Ejemplo n.º 2
0
        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;
                        }
                    }
                }
            }
        }
Ejemplo n.º 3
0
        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;
                        }
                    }
                }
            }

        }
Ejemplo n.º 4
0
        public static WebFile FromUrlUntracked(Uri url, HttpResponseMessage partialResponse, bool continueDownload)
        {
            var existing = new WebFile(url);
            existing.SaveResponseInfo(partialResponse, continueDownload);
            return existing;

        }