Пример #1
0
        private void HandleTrimming(LostFocusBehavior behavior)
        {
            if (!behavior.TrimLeadingZero)
            {
                return;
            }

            _textBox.Text = string.Format("{0}", _number.CurrentNumber);
        }
Пример #2
0
        private void HandleFormatting(LostFocusBehavior behavior)
        {
            if (string.IsNullOrWhiteSpace(behavior.FormatText))
            {
                return;
            }

            _textBox.Text = string.Format(behavior.FormatText, _number.CurrentNumber);
        }
Пример #3
0
        private void HandleNullValue(LostFocusBehavior behavior)
        {
            if (_number.CurrentNumber != null)
            {
                return;
            }
            switch (behavior.Value)
            {
            case ValueBehavior.PlaceDefaultNumber:
                _number.Reset();
                break;

            case ValueBehavior.PlaceMaximumNumber:
                _number.ToMaximum();
                break;

            case ValueBehavior.PlaceMinimumNumber:
                _number.ToMinimum();
                break;
            }

            TakeNumber();
            _textBox.Text = _number.ToString();
        }