public void DownloadProgressChangedHandler(object sender, EventArgs e) { if (DateTime.UtcNow > LastUpdateTime.AddSeconds(1)) { CalcuclateDownloadSpeed(); CalculateAverageRate(); UpdateDownlpadDisplay(); LastUpdateTime = DateTime.UtcNow; } }
private void UpgradeProperties() { if (DateTime.Now > LastUpdateTime.AddSeconds(1)) { OnPropertyChanged("SpeedString"); OnPropertyChanged("TotalUsedTimeString"); LastUpdateTime = DateTime.Now; } OnPropertyChanged("SizeString"); OnPropertyChanged("Progress"); }