ACAT.Extensions.Default.UI.Dialogs.ScreenLockForm.handlePinInput C# (CSharp) Method

handlePinInput() private method

The 'value' is the pin the user entered. Verify if this is a valid pin and 'unlock' the digits entered so far. If the whole pin has been entered unlock the display. After each digit is entered, transitions the animation to the next one
private handlePinInput ( String value ) : void
value String pin value entered so far
return void
        private void handlePinInput(String value)
        {
            int nextIndex = _pinEntered.Length;
            if (nextIndex >= _pin.Length)
            {
                return;
            }

            if (value[0] == _pin[nextIndex])
            {
                _pinEntered = _pinEntered + value;
                Log.Debug("pin: " + _pin + ", _pinEntered: " + _pinEntered);
                switch (_pinEntered.Length)
                {
                    case 1:
                        _animationManager.Transition("FirstKey");
                        break;

                    case 2:
                        _animationManager.Transition("SecondKey");
                        break;

                    case 3:
                        _animationManager.Transition("ThirdKey");
                        break;

                    case 4:
                        _animationManager.Transition("FourthKey");
                        break;
                }

                if (_pinEntered.Length == _pin.Length)
                {
                    unlockScreen();
                }
            }
            else
            {
                AuditLog.Audit(new AuditEventScreenLock("invalidpin"));

                _pinEntered = String.Empty;
                _animationManager.Transition("TopLevel");
            }
        }