Catrobat.IDE.WindowsPhone.Controls.FormulaControls.FormulaKeyboard.CheckSensorKeys C# (CSharp) Метод

CheckSensorKeys() приватный Метод

private CheckSensorKeys ( FormulaKey key ) : bool
key Catrobat.IDE.Core.ViewModels.Editor.Formula.FormulaKey
Результат bool
        private bool CheckSensorKeys(FormulaKey key)
        {
            if (key.Key.Equals(FormulaEditorKey.AccelerationX) ||
                key.Key.Equals(FormulaEditorKey.AccelerationY) ||
                key.Key.Equals(FormulaEditorKey.AccelerationZ))
            {
                if (!ServiceLocator.SensorService.IsAccelarationEnabled())
                {
                    return false;
                }

                return true;
            }

            if (key.Key.Equals(FormulaEditorKey.Compass))
            {
                if (!ServiceLocator.SensorService.IsCompassEnabled())
                {
                    return false;
                }

                return true;
            }

            if (key.Key.Equals(FormulaEditorKey.InclinationX) ||
                key.Key.Equals(FormulaEditorKey.InclinationY))
            {
                if (!ServiceLocator.SensorService.IsInclinationEnabled())
                {
                    return false;
                }

                return true;
            }

            return true;
        }

Same methods

FormulaKeyboard::CheckSensorKeys ( ) : void