示例#1
0
        public bool ProcessPendingMessage(Message message)
        {
            if (!Settings.Default.RunAsServer)
            {
                return(false);
            }
            var toReturn = false;

            if (message == null)
            {
                return(false);
            }
            var messageType = message.MessageType;

            if (messageType == null)
            {
                return(false);
            }
            switch (messageType)
            {
            case "Falcon4SendCallbackMessage":
                var callback = (string)message.Payload;
                _falconCallbackSender.SendCallbackToFalcon(callback);
                toReturn = true;
                break;

            case "Falcon4IncreaseALOW":
            {
                _increaseAlowEventHandler.IncreaseAlow();
                toReturn = true;
            }
            break;

            case "Falcon4DecreaseALOW":
            {
                _decreaseAlowEventHandler.DecreaseAlow();
                toReturn = true;
            }
            break;

            case "Falcon4IncreaseBaro":
            {
                _increaseBaroEventHandler.IncreaseBaro();
                toReturn = true;
            }
            break;

            case "Falcon4DecreaseBaro":
            {
                _decreaseBaroEventHandler.DecreaseBaro();
                toReturn = true;
            }
            break;
            }
            return(toReturn);
        }
        public void HandleOptionSelectButtonPress(OptionSelectButton button)
        {
            var functionName = button.FunctionName;

            if (!String.IsNullOrEmpty(functionName))
            {
                switch (functionName)
                {
                case "CourseSelectIncrease":
                    _courseSelectIncreaseEventHandler.CourseSelectIncrease();
                    break;

                case "CourseSelectDecrease":
                    _courseSelectDecreaseEventHandler.CourseSelectDecrease();
                    break;

                case "HeadingSelectIncrease":
                    _headingSelectIncreaseEventHandler.HeadingSelectIncrease();
                    break;

                case "HeadingSelectDecrease":
                    _headingSelectDecreaseEventHandler.HeadingSelectDecrease();
                    break;

                case "BarometricPressureSettingIncrease":
                    _increaseBaroEventHandler.IncreaseBaro();
                    break;

                case "BarometricPressureSettingDecrease":
                    _decreaseBaroEventHandler.DecreaseBaro();
                    break;

                case "LowAltitudeWarningThresholdIncrease":
                    _increaseAlowEventHandler.IncreaseAlow();
                    break;

                case "LowAltitudeWarningThresholdDecrease":
                    _decreaseAlowEventHandler.DecreaseAlow();
                    break;

                case "AcknowledgeMessage":
                    //SendCallbackToFalcon("SimICPFAck");
                    break;
                }
            }
        }