public ProgressContent(HttpContent innerContent, ProgressMessageHandler handler, HttpRequestMessage request)
        {
            Contract.Assert(innerContent != null);
            Contract.Assert(handler != null);
            Contract.Assert(request != null);

            this._innerContent = innerContent;
            this._handler = handler;
            this._request = request;

            innerContent.Headers.CopyTo(this.Headers);
        }
Beispiel #2
0
        public ProgressContent(HttpContent innerContent, ProgressMessageHandler handler, HttpRequestMessage request)
        {
            Contract.Assert(innerContent != null);
            Contract.Assert(handler != null);
            Contract.Assert(request != null);

            this._innerContent = innerContent;
            this._handler      = handler;
            this._request      = request;

            innerContent.Headers.CopyTo(this.Headers);
        }
        public ProgressStream(Stream innerStream, ProgressMessageHandler handler, HttpRequestMessage request, HttpResponseMessage response)
            : base(innerStream)
        {
            Contract.Assert(handler != null);
            Contract.Assert(request != null);

            if (request.Content != null)
            {
                this._totalBytesToSend = request.Content.Headers.ContentLength;
            }

            if (response != null && response.Content != null)
            {
                this._totalBytesToReceive = response.Content.Headers.ContentLength;
            }

            this._handler = handler;
            this._request = request;
        }
Beispiel #4
0
        public ProgressStream(Stream innerStream, ProgressMessageHandler handler, HttpRequestMessage request, HttpResponseMessage response)
            : base(innerStream)
        {
            Contract.Assert(handler != null);
            Contract.Assert(request != null);

            if (request.Content != null)
            {
                this._totalBytesToSend = request.Content.Headers.ContentLength;
            }

            if (response != null && response.Content != null)
            {
                this._totalBytesToReceive = response.Content.Headers.ContentLength;
            }

            this._handler = handler;
            this._request = request;
        }