AC.AvalonControlsLibrary.Controls.TimePicker.HoursTextChanged C# (CSharp) Method

HoursTextChanged() private method

private HoursTextChanged ( object sender, System.Windows.Input.TextCompositionEventArgs e ) : void
sender object
e System.Windows.Input.TextCompositionEventArgs
return void
        private void HoursTextChanged(object sender, TextCompositionEventArgs e)
        {
            //delete the text that is highlight(selected)
            TrimSelectedText(hours);

            //Adjust the text according to the carrot index
            string newText = AdjustText(hours, e.Text);
            
            //validates that the hour is correct if not set a valid value (0 or 24)
            int hourNum = ValidateAndSetHour(newText);

            //moves the carrot index or focus the neighbour
            AdjustCarretIndexOrMoveToNeighbour(hours, minutes);

            //handle the event so that it does not set the text, since we do it manually
            e.Handled = true;
        }