Exemplo n.º 1
0
        private Object ValidateTextTextBox(ValidatableTextBox textBox, String text)
        {
            if (text.Length == 0 || text.Length > 1)
            {
                return(text);
            }

            return(textBox);
        }
Exemplo n.º 2
0
        private Object ValidateNumericTextBox(ValidatableTextBox textBox, String text)
        {
            if (String.IsNullOrEmpty(text))
            {
                return(null);
            }

            if (Int32.TryParse(text, out Int32 value))
            {
                return(value);
            }

            return(textBox);
        }
Exemplo n.º 3
0
        private Object ValidateDateTimeTextBox(ValidatableTextBox textBox, String text)
        {
            if (String.IsNullOrEmpty(text))
            {
                return(null);
            }

            if (DateTime.TryParse(text, out DateTime parsedTime))
            {
                return(parsedTime);
            }

            return(textBox);
        }