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

AdjustCarretIndexOrMoveToNeighbour() private static method

private static AdjustCarretIndexOrMoveToNeighbour ( TextBox current, TextBox neighbour ) : void
current System.Windows.Controls.TextBox
neighbour System.Windows.Controls.TextBox
return void
        private static void AdjustCarretIndexOrMoveToNeighbour(TextBox current, TextBox neighbour)
        {
            //if the current is near the end move to neighbour
            if (current.CaretIndex == 1 && neighbour != null)
                neighbour.Focus();

                //if the carrot is in the first index move the caret one index
            else if (current.CaretIndex == 0)
                current.CaretIndex++;
        }