private void UpdateInputScope(InputScope inputScope) { if (_textBoxView != null) { var inputType = InputScopeHelper.ConvertInputScope(inputScope ?? InputScope); inputType = InputScopeHelper.ConvertToCapitalization(inputType, inputScope ?? InputScope); if (!IsSpellCheckEnabled) { inputType = InputScopeHelper.ConvertToRemoveSuggestions(inputType, ShouldForceDisableSpellCheck); } if (AcceptsReturn) { inputType |= InputTypes.TextFlagMultiLine; } if (IsReadOnly) { inputType = InputTypes.Null; } _textBoxView.InputType = inputType; } }
private InputTypes AdjustInputTypes(InputTypes inputType, InputScope inputScope) { inputType = InputScopeHelper.ConvertToCapitalization(inputType, inputScope); if (!IsSpellCheckEnabled) { inputType = InputScopeHelper.ConvertToRemoveSuggestions(inputType, ShouldForceDisableSpellCheck); } if (AcceptsReturn) { inputType |= InputTypes.TextFlagMultiLine; } return(inputType); }
private void UpdateInputScope(InputScope inputScope) { if (_textBoxView != null) { var inputType = InputScopeHelper.ConvertInputScope(inputScope ?? InputScope); inputType = InputScopeHelper.ConvertToCapitalization(inputType, inputScope ?? InputScope); if (!IsSpellCheckEnabled) { inputType = InputScopeHelper.ConvertToRemoveSuggestions(inputType, ShouldForceDisableSpellCheck); } if (AcceptsReturn) { inputType |= InputTypes.TextFlagMultiLine; } if (IsReadOnly) { _textBoxView.InputType = InputTypes.Null; // Clear the listener so the inputs have no effect. // Setting the input type to InputTypes.Null is not enough. _listener = _textBoxView.KeyListener; _textBoxView.KeyListener = null; } else { if (_listener != null) { _textBoxView.KeyListener = _listener; } _textBoxView.InputType = inputType; } } }