예제 #1
0
        private void DigitClickHandler(object sender, FrequencyEditDigitClickEventArgs args)
        {
            if (_currentEntryMode != EntryMode.None)
            {
                LeaveEntryMode();
                return;
            }

            var digit = (FrequencyEditDigit)sender;

            if (digit != null)
            {
                _newFrequency = _frequency;
                if (args.Button == MouseButtons.Right)
                {
                    ZeroDigits(digit.DigitIndex);
                }
                else
                {
                    if (args.IsUpperHalf && _frequency >= 0)
                    {
                        IncrementDigit(digit.DigitIndex, true);
                    }
                    else
                    {
                        DecrementDigit(digit.DigitIndex, true);
                    }
                }

                if (_newFrequency != _frequency)
                {
                    _frequencyChangingEventArgs.Accept    = true;
                    _frequencyChangingEventArgs.Frequency = _newFrequency;
                    if (FrequencyChanging != null)
                    {
                        FrequencyChanging(this, _frequencyChangingEventArgs);
                    }
                    if (_frequencyChangingEventArgs.Accept)
                    {
                        _frequency = _frequencyChangingEventArgs.Frequency;
                        UpdateDigitsValues();
                        if (FrequencyChanged != null)
                        {
                            FrequencyChanged(this, EventArgs.Empty);
                        }
                    }
                    else
                    {
                        UpdateDigitsValues();
                    }
                }
            }
        }
예제 #2
0
        private void DigitClickHandler(object sender, FrequencyEditDigitClickEventArgs args)
        {
            if (this._currentEntryMode != EntryMode.None)
            {
                this.LeaveEntryMode();
                return;
            }
            FrequencyEditDigit frequencyEditDigit = (FrequencyEditDigit)sender;

            if (frequencyEditDigit != null)
            {
                this._newFrequency = this._frequency;
                if (args.Button == MouseButtons.Right)
                {
                    this.ZeroDigits(frequencyEditDigit.DigitIndex);
                }
                else if (args.IsUpperHalf && this._frequency >= 0L)
                {
                    this.IncrementDigit(frequencyEditDigit.DigitIndex, true);
                }
                else
                {
                    this.DecrementDigit(frequencyEditDigit.DigitIndex, true);
                }
                if (this._newFrequency != this._frequency)
                {
                    this._frequencyChangingEventArgs.Accept    = true;
                    this._frequencyChangingEventArgs.Frequency = this._newFrequency;
                    if (!this._disableFrequencyEvents && this.FrequencyChanging != null)
                    {
                        this.FrequencyChanging(this, this._frequencyChangingEventArgs);
                    }
                    if (this._frequencyChangingEventArgs.Accept)
                    {
                        this._frequency = this._frequencyChangingEventArgs.Frequency;
                        this.UpdateDigitsValues();
                        if (!this._disableFrequencyEvents && this.FrequencyChanged != null)
                        {
                            this.FrequencyChanged(this, EventArgs.Empty);
                            return;
                        }
                    }
                    else
                    {
                        this.UpdateDigitsValues();
                    }
                }
            }
        }
        private void DigitClickHandler(object sender, FrequencyEditDigitClickEventArgs args)
        {
            if (_currentEntryMode != EntryMode.None)
            {
                LeaveEntryMode();
                return;
            }

            var digit = (FrequencyEditDigit)sender;
            if (digit != null)
            {
                _newFrequency = _frequency;
                if (args.Button == MouseButtons.Right)
                {
                    ZeroDigits(digit.DigitIndex);
                }
                else
                {
                    if (args.IsUpperHalf && _frequency >= 0)
                    {
                        IncrementDigit(digit.DigitIndex,true);
                    }
                    else
                    {
                        DecrementDigit(digit.DigitIndex,true);
                    }
                }

                if (_newFrequency != _frequency)
                {
                    _frequencyChangingEventArgs.Accept = true;
                    _frequencyChangingEventArgs.Frequency = _newFrequency;
                    if (FrequencyChanging != null)
                    {
                        FrequencyChanging(this, _frequencyChangingEventArgs);
                    }
                    if (_frequencyChangingEventArgs.Accept)
                    {
                        _frequency = _frequencyChangingEventArgs.Frequency;
                        UpdateDigitsValues();
                        if (FrequencyChanged != null)
                        {
                            FrequencyChanged(this, EventArgs.Empty);
                        }
                    }
                    else
                    {
                        UpdateDigitsValues();
                    }
                }
            }
        }
예제 #4
0
 private void DigitClickHandler(object sender, FrequencyEditDigitClickEventArgs args)
 {
     if (this._currentEntryMode != EntryMode.None)
       {
     this.LeaveEntryMode();
       }
       else
       {
     FrequencyEditDigit frequencyEditDigit = (FrequencyEditDigit) sender;
     if (frequencyEditDigit == null)
       return;
     this._newFrequency = this._frequency;
     if (args.Button == MouseButtons.Right)
       this.ZeroDigits(frequencyEditDigit.DigitIndex);
     else if (args.IsUpperHalf && this._frequency >= 0L)
       this.IncrementDigit(frequencyEditDigit.DigitIndex, true);
     else
       this.DecrementDigit(frequencyEditDigit.DigitIndex, true);
     if (this._newFrequency == this._frequency)
       return;
     this._frequencyChangingEventArgs.Accept = true;
     this._frequencyChangingEventArgs.Frequency = this._newFrequency;
     if (this.FrequencyChanging != null)
       this.FrequencyChanging((object) this, this._frequencyChangingEventArgs);
     if (this._frequencyChangingEventArgs.Accept)
     {
       this._frequency = this._frequencyChangingEventArgs.Frequency;
       this.UpdateDigitsValues();
       if (this.FrequencyChanged == null)
     return;
       this.FrequencyChanged((object) this, EventArgs.Empty);
     }
     else
       this.UpdateDigitsValues();
       }
 }