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

SecondsTextChanged() private method

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

            //Adjust the text according to the carrot index
            string newText = AdjustText(seconds, e.Text);

            //validates that the second is correct if not set a valid value (0 or 59)
            int secNum = ValidateAndSetSeconds(newText);

            //moves the carrot index or focus the neighbour
            AdjustCarretIndexOrMoveToNeighbour(seconds, null);

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