示例#1
0
        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
            }
        }
示例#2
0
        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)
            {
            }
        }
示例#3
0
        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)
            {
            }
        }
示例#4
0
        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
                }
            }
        }
示例#5
0
        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
            }
        }