Example #1
0
 /// <summary>
 /// Raises the <see cref="E:BandwidthChanged" /> event.
 /// </summary>
 /// <param name="e">The <see cref="BandwidthEventArgs"/> instance containing the event data.</param>
 internal void OnBandwidthChanged(BandwidthEventArgs e)
 {
     if (bandwidthChangedHandlers != null)
     {
         bandwidthChangedHandlers(client, e);
     }
 }
Example #2
0
        private void spectrumAnalyzer_BandwidthChanged(object sender, BandwidthEventArgs e)
        {
            var sign = e.Side == BandType.Upper ? 1 : -1;

            if (e.Bandwidth > _control.FilterBandwidth || Math.Abs(_spectrumAnalyzer.FilterOffset + sign * e.Bandwidth / 2) > _control.FilterBandwidth / 2)
            {
                e.Cancel = true;
                return;
            }
            _filterbandwidth = e.Bandwidth;
            _filterOffset    = e.Offset;
            _updateFilter    = true;
        }
Example #3
0
 private void Status_BandwidthChanged(object sender, BandwidthEventArgs e)
 {
     Console.WriteLine(".... in BC ....");
     Invoke((Action) delegate
     {
         if (e.Downloaded.Value == 0 && e.Uploaded.Value == 0)
         {
             uiTabbedBrowserControl.SetLoggedLabel("");
         }
         else
         {
             uiTabbedBrowserControl.SetLoggedLabel(string.Format("Down: {0}/s, Up: {1}/s", e.Downloaded, e.Uploaded));
         }
     });
 }
Example #4
0
 /// <summary>
 /// Called when the bandwidth values within the client are changed.
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="e">The <see cref="BandwidthEventArgs"/> instance containing the event data.</param>
 private void onClientBandwidthChanged(object sender, BandwidthEventArgs e)
 {
     if (_closing)
     {
         return;
     }
     Invoke((Action) delegate {
         if (e.Downloaded.Value == 0 && e.Uploaded.Value == 0)
         {
             lbLog.Text = "";
         }
         else
         {
             lbLog.Text = string.Format("Down: {0}/s, Up: {1}/s", e.Downloaded, e.Uploaded);
         }
     });
 }
        private void OnClientBandwidthChanged(object sender, BandwidthEventArgs e)
        {
            if (closing)
            {
                return;
            }

            Invoke((Action) delegate
            {
                if (e.Downloaded.Value == 0 && e.Uploaded.Value == 0)
                {
                    lblUp.Text   = "0 KBytes/s";
                    lblDown.Text = "0 KBytes/s";
                }
                else
                {
                    lblUp.Text   = e.Uploaded + "/s";
                    lblDown.Text = e.Downloaded + "/s";
                }
            });
        }
 private void Status_BandwidthChanged(object sender, BandwidthEventArgs e)
 {
     Invoke((Action)delegate
     {
         if (e.Downloaded.Value == 0 && e.Uploaded.Value == 0)
             uiTabbedBrowserControl.SetStatusLabel("");
         else
             uiTabbedBrowserControl.SetStatusLabel(string.Format("Down: {0}/s, Up: {1}/s", e.Downloaded, e.Uploaded));
     });
 }