void BandwidthManager_BandwidthChanged(object sender, EventArgs e) { Phoenix.Communication.BandwidthManager man = Phoenix.Communication.CommunicationManager.BandwidthManager; upBandBox.Text = SizeConverter.ToOptimal(man.UploadBandwidth); upTotalBox.Text = SizeConverter.ToOptimal(man.TotalUpload); downBandBox.Text = SizeConverter.ToOptimal(man.DownloadBandwidth); downTotalBox.Text = SizeConverter.ToOptimal(man.TotalDownload); if ((long)timeConnected.TotalSeconds > 0) { averageUpBandBox.Text = SizeConverter.ToOptimal(man.TotalUpload / (long)timeConnected.TotalSeconds); averageDownBandBox.Text = SizeConverter.ToOptimal(man.TotalDownload / (long)timeConnected.TotalSeconds); } else { averageUpBandBox.Text = SizeConverter.ToOptimal(0); averageDownBandBox.Text = SizeConverter.ToOptimal(0); } }