// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using System.ComponentModel;
namespace System.Net.Http.Handlers
{
///
/// Provides data for the events generated by .
///
public class HttpProgressEventArgs : ProgressChangedEventArgs
{
///
/// Initializes a new instance of the with the parameters given.
///
/// The percent completed of the overall exchange.
/// Any user state provided as part of reading or writing the data.
/// The current number of bytes either received or sent.
/// The total number of bytes expected to be received or sent.
public HttpProgressEventArgs(int progressPercentage, object userToken, long bytesTransferred, long? totalBytes)
: base(progressPercentage, userToken)
{
BytesTransferred = bytesTransferred;
TotalBytes = totalBytes;
}
///
/// Gets the current number of bytes transferred.
///
public long BytesTransferred { get; private set; }
///
/// Gets the total number of expected bytes to be sent or received. If the number is not known then this is null.
///
public long? TotalBytes { get; private set; }
}
}