SetRemoveStringFormatFromText() private méthode

private SetRemoveStringFormatFromText ( string stringFormat ) : void
stringFormat string
Résultat void
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown nud = (NumericUpDown)d;

            nud.SetRemoveStringFormatFromText((string)e.NewValue);
            if (nud._valueTextBox != null &&
                nud.Value.HasValue)
            {
                nud._valueTextBox.Text = nud.Value.Value.ToString((string)e.NewValue);
            }
        }
Exemple #2
0
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown numericUpDown = (NumericUpDown)d;

            numericUpDown.SetRemoveStringFormatFromText((string)e.NewValue);
            if (numericUpDown._valueTextBox != null && numericUpDown.Value.HasValue)
            {
                numericUpDown.InternalSetText(numericUpDown.Value);
            }
            numericUpDown.HasDecimals = !NumericUpDown.RegexStringFormatHexadecimal.IsMatch((string)e.NewValue);
        }
Exemple #3
0
        private static void OnStringFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NumericUpDown nud = (NumericUpDown)d;

            nud.SetRemoveStringFormatFromText((string)e.NewValue);
            if (nud._valueTextBox != null &&
                nud.Value.HasValue)
            {
                nud.InternalSetText(nud.Value);
            }

            if (!nud.HasDecimals && RegexStringFormatHexadecimal.IsMatch((string)e.NewValue))
            {
                nud.SetCurrentValue(HasDecimalsProperty, true);
            }
        }