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); } }
public override int Main(Dictionary <string, object> data) { string msg = CoreLib.Current.Languages.Get("ERestartAppMsg"); string btnAdmin = CoreLib.Current.Languages.Get("ERestartAppBtnAdmin"); string btnNormal = CoreLib.Current.Languages.Get("ERestartAppBtnNormal"); ChoiceResult choiceResult = Ux.DoChoice(msg, btnAdmin, btnNormal); switch (choiceResult) { case ChoiceResult.Left: App.RestartAppAsAdmin(); break; case ChoiceResult.Right: App.RestartApp(); break; default: return(ERR_CANCELED_BY_USER); } return(OK); }