private void InternalDownloadProgressChanged(int cachedSize)
{
int speed = 0;
DateTime current = DateTime.Now;
TimeSpan interval = current - lastNotificationTime;
if (interval.TotalSeconds < 60)
{
speed = (int)Math.Floor((this.DownloadedSize + cachedSize - this.lastNotificationDownloadedSize) / interval.TotalSeconds);
}
lastNotificationTime = current;
lastNotificationDownloadedSize = this.DownloadedSize + cachedSize;
this.OnDownloadProgressChanged(new DownloadProgressChangedEventArgs
(this.DownloadedSize + cachedSize, this.TotalSize, speed));
}