Exemplo n.º 1
0
        public override int Main(Dictionary <string, object> args)
        {
            string messageOfChoice    = CoreLib.Current.Languages.Get("EDpiModiferMessageOfChoice");
            string leftOfChoice       = CoreLib.Current.Languages.Get("EDpiModiferLeftChoice");
            string rightOfChoice      = CoreLib.Current.Languages.Get("EDpiModiferRightChoice");
            string messageInputNumber = CoreLib.Current.Languages.Get("EDpiModiferHintOfInputNumber");

            var choiceResult = Ux.DoChoice(messageOfChoice, leftOfChoice, rightOfChoice);
            var wm           = new WindowManager(TargetDevice);

            switch (choiceResult)
            {
            case OpenFramework.Open.ChoiceResult.Cancel:
                return(ERR_CANCELED_BY_USER);

            case OpenFramework.Open.ChoiceResult.Left:
                //case OpenFramework.Open.ChoiceResult.Deny:
                int target = Ux.InputNumber(messageInputNumber, min: 100, max: 1000);
                wm.Density = target;
                TargetDevice.Reboot2System();
                return(OK);

            case OpenFramework.Open.ChoiceResult.Right:
                //case OpenFramework.Open.ChoiceResult.Accept:
                wm.ResetDensity();
                TargetDevice.Reboot2System();
                return(OK);

            default:
                return(ERR);
            }
        }