public void OnBandwidthUpdated(long upload, long download) { if (InvokeRequired) { BeginInvoke(new Action <long, long>(OnBandwidthUpdated), upload, download); return; } try { if (upload < 1 || download < 1) { return; } UsedBandwidthLabel.Text = $"{i18N.Translate("Used", ": ")}{Bandwidth.Compute(upload + download)}"; UploadSpeedLabel.Text = $"↑: {Bandwidth.Compute(upload - LastUploadBandwidth)}/s"; DownloadSpeedLabel.Text = $"↓: {Bandwidth.Compute(download - LastDownloadBandwidth)}/s"; LastUploadBandwidth = upload; LastDownloadBandwidth = download; Refresh(); } catch { // ignored } }
public void OnBandwidthUpdated(long download) { try { UsedBandwidthLabel.Text = $"{i18N.Translate("Used", ": ")}{Bandwidth.Compute(download)}"; //UploadSpeedLabel.Text = $"↑: {Utils.Bandwidth.Compute(upload - LastUploadBandwidth)}/s"; DownloadSpeedLabel.Text = $"↑↓: {Bandwidth.Compute(download - LastDownloadBandwidth)}/s"; //LastUploadBandwidth = upload; LastDownloadBandwidth = download; Refresh(); } catch (Exception) { } }
public void OnBandwidthUpdated(long upload, long download) { try { if (upload < 1 || download < 1) { return; } UsedBandwidthLabel.Text = $"{i18N.Translate("Used",": ")}{Bandwidth.Compute(upload + download)}"; UploadSpeedLabel.Text = $"↑: {Bandwidth.Compute(upload - LastUploadBandwidth)}/s"; DownloadSpeedLabel.Text = $"↓: {Bandwidth.Compute(download - LastDownloadBandwidth)}/s"; LastUploadBandwidth = upload; LastDownloadBandwidth = download; Refresh(); } catch (Exception) { } }
public void OnBandwidthUpdated(ulong download) { if (InvokeRequired) { BeginInvoke(new Action <ulong>(OnBandwidthUpdated), download); return; } if (State == State.Started) { try { labelUsed.Text = $"{Bandwidth.Compute(download)}"; labelSpeed.Text = $"{Bandwidth.Compute(download - LastDownloadBandwidth)}/s"; //LastUploadBandwidth = upload; LastDownloadBandwidth = download; Refresh(); } catch { // ignored } } }
public void OnBandwidthUpdated(ulong download) { if (InvokeRequired) { BeginInvoke(new Action <ulong>(OnBandwidthUpdated), download); return; } try { UsedBandwidthLabel.Text = $"{i18N.Translate("Used", ": ")}{Bandwidth.Compute(download)}"; //UploadSpeedLabel.Text = $"↑: {Utils.Bandwidth.Compute(upload - LastUploadBandwidth)}/s"; DownloadSpeedLabel.Text = $"↑↓: {Bandwidth.Compute(download - LastDownloadBandwidth)}/s"; //LastUploadBandwidth = upload; LastDownloadBandwidth = download; Refresh(); } catch { // ignored } }