Beispiel #1
0
        private void UpdateBandwidth(int bw)
        {
            bw = 10 * (bw / 10);
            if (bw < 10)
            {
                bw = 10;
            }
            int num = (int)((float)(18 * this._spectrumWidth) / this._scale / (float)(this._buffer.Width - 60));

            if (bw < num)
            {
                bw = num;
            }
            if (bw != this._filterBandwidth)
            {
                int num2   = this._enableSideFilterResize ? ((int)((float)(bw - this._filterBandwidth) * 0.5f)) : 0;
                int offset = this._filterOffset + ((this._side == BandType.Upper) ? num2 : (-num2));
                BandwidthEventArgs bandwidthEventArgs = new BandwidthEventArgs(bw, offset, this._side);
                this.OnBandwidthChanged(bandwidthEventArgs);
                if (!bandwidthEventArgs.Cancel)
                {
                    this._filterOffset    = bandwidthEventArgs.Offset;
                    this._filterBandwidth = bandwidthEventArgs.Bandwidth;
                    this._performNeeded   = true;
                }
            }
        }
Beispiel #2
0
 protected virtual void OnBandwidthChanged(BandwidthEventArgs e)
 {
     if (BandwidthChanged != null)
     {
         BandwidthChanged(this, e);
     }
 }
Beispiel #3
0
        protected virtual void OnBandwidthChanged(BandwidthEventArgs e)
        {
            ManualBandwidthChangeEventHandler bandwidthChanged = this.BandwidthChanged;

            if (bandwidthChanged != null)
            {
                bandwidthChanged(this, e);
            }
        }
Beispiel #4
0
        private void UpdateBandwidth(int bw)
        {
            bw = 10 * (bw / 10);

            if (bw < 10)
            {
                bw = 10;
            }

            if (bw != _filterBandwidth)
            {
                var args = new BandwidthEventArgs(bw);
                OnBandwidthChanged(args);
                if (!args.Cancel)
                {
                    _filterBandwidth = args.Bandwidth;
                    _performNeeded   = true;
                }
            }
        }
Beispiel #5
0
        private void panview_BandwidthChanged(object sender, BandwidthEventArgs e)
        {
            if (e.Bandwidth < filterBandwidthNumericUpDown.Minimum)
            {
                e.Bandwidth = (int)filterBandwidthNumericUpDown.Minimum;
            }
            else if (e.Bandwidth > filterBandwidthNumericUpDown.Maximum)
            {
                e.Bandwidth = (int)filterBandwidthNumericUpDown.Maximum;
            }

            filterBandwidthNumericUpDown.Value = e.Bandwidth;
        }
        private void UpdateBandwidth(int bw)
        {
            bw = 10 * (bw / 10);

            if (bw < 10)
            {
                bw = 10;
            }

            if (bw != _filterBandwidth)
            {
                var args = new BandwidthEventArgs(bw);
                OnBandwidthChanged(args);
                if (!args.Cancel)
                {
                    _filterBandwidth = args.Bandwidth;
                    _performNeeded = true;
                }
            }
        }
 protected virtual void OnBandwidthChanged(BandwidthEventArgs e)
 {
     if (BandwidthChanged != null)
     {
         BandwidthChanged(this, e);
     }
 }
 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;
 }
Beispiel #9
0
 private void spectrumAnalyzer_BandwidthChanged(object sender, BandwidthEventArgs e)
 {
     int num = e.Side == BandType.Upper ? 1 : -1;
       if (e.Bandwidth > this._control.FilterBandwidth || Math.Abs(this._spectrumAnalyzer.FilterOffset + num * e.Bandwidth / 2) > this._control.FilterBandwidth / 2)
       {
     e.Cancel = true;
       }
       else
       {
     this._filterbandwidth = e.Bandwidth;
     this._filterOffset = e.Offset;
     this._updateFilter = true;
       }
 }
Beispiel #10
0
 protected virtual void OnBandwidthChanged(BandwidthEventArgs e)
 {
     ManualBandwidthChangeEventHandler changeEventHandler = this.BandwidthChanged;
       if (changeEventHandler == null)
     return;
       changeEventHandler((object) this, e);
 }
Beispiel #11
0
 private void UpdateBandwidth(int bw)
 {
     bw = 10 * (bw / 10);
       if (bw < 10)
     bw = 10;
       if (bw == this._filterBandwidth)
     return;
       int num = this._enableSideFilterResize ? (bw - this._filterBandwidth) / 2 : 0;
       int offset = this._filterOffset + (this._side == BandType.Upper ? num : -num);
       BandwidthEventArgs e = new BandwidthEventArgs(bw, offset, this._side);
       this.OnBandwidthChanged(e);
       if (e.Cancel)
     return;
       this._filterOffset = e.Offset;
       this._filterBandwidth = e.Bandwidth;
       this._performNeeded = true;
 }
Beispiel #12
0
 private void panview_BandwidthChanged(object sender, BandwidthEventArgs e)
 {
     if ((Decimal) e.Bandwidth < this.filterBandwidthNumericUpDown.Minimum)
     e.Bandwidth = (int) this.filterBandwidthNumericUpDown.Minimum;
       else if ((Decimal) e.Bandwidth > this.filterBandwidthNumericUpDown.Maximum)
     e.Bandwidth = (int) this.filterBandwidthNumericUpDown.Maximum;
       this.filterBandwidthNumericUpDown.Value = (Decimal) e.Bandwidth;
 }