old mode 100755
new mode 100644
| | |
| | | FrameLayout bodyView; |
| | | VerticalScrolViewLayout contentView; |
| | | Button btnOnText; |
| | | Button btnBrightnessText; |
| | | |
| | | Scene scene; |
| | | |
| | |
| | | btnConfrim.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | var temp = scene.functions.Find((obj) => obj.sid == sceneFunction.sid); |
| | | if (sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness) != null) |
| | | { |
| | | try |
| | | { |
| | | //一端口不支持开关值与亮度值一起处理,需要将开关值移除掉 |
| | | sceneFunction.status.Remove(sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff)); |
| | | } |
| | | catch { } |
| | | } |
| | | if (temp != null) |
| | | { |
| | | temp = sceneFunction; |
| | |
| | | if (result == DAL.Server.StateCode.SUCCESS) |
| | | { |
| | | refreshAction(); |
| | | this.RemoveFromParent(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | else |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | refreshAction(); |
| | | refreshAction(); |
| | | this.RemoveFromParent(); |
| | | } |
| | | }; |
| | |
| | | { |
| | | row.AddChidren(new Button() { X = Application.GetRealWidth(16), Height = Application.GetRealHeight(1), Width = Application.GetRealWidth(343), BackgroundColor = CSS_Color.DividingLineColor }); |
| | | } |
| | | Button btnBrightnessRight = new Button() |
| | | Button btnRight = new Button() |
| | | { |
| | | X = Application.GetRealWidth(339), |
| | | Gravity = Gravity.CenterVertical, |
| | |
| | | Height = Application.GetMinRealAverage(16), |
| | | UnSelectedImagePath = "Public/Right.png", |
| | | }; |
| | | row.AddChidren(btnBrightnessRight); |
| | | row.AddChidren(btnRight); |
| | | |
| | | var btnFunctionText = new Button() |
| | | { |
| | |
| | | }; |
| | | row.AddChidren(btnFunctionText); |
| | | if (sceneStatus.key == FunctionAttributeKey.OnOff) |
| | | { |
| | | btnOnText = btnFunctionText; |
| | | } |
| | | else if (sceneStatus.key == FunctionAttributeKey.Brightness) |
| | | { |
| | | btnBrightnessText = btnFunctionText; |
| | | } |
| | | |
| | | var btnFunctionName = new Button() |
| | | { |
| | |
| | | trait.value = "on"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "on"; |
| | | btn.Text = FunctionList.List.GetValueText(trait.key, trait.value) + FunctionList.List.GetUintString(trait.key); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (temp != null) |
| | | { |
| | | if (temp.value == "0") |
| | | { |
| | | temp.value = "100"; |
| | | } |
| | | btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | } |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender,e) =>{ |
| | | dialog.Close(); |
| | | trait.value = "off"; |
| | | sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.OnOff).value = "off"; |
| | | btn.Text= FunctionList.List.GetValueText(trait.key,trait.value) + FunctionList.List.GetUintString(trait.key); |
| | | |
| | | var temp = sceneFunction.status.Find((obj) => obj.key == FunctionAttributeKey.Brightness); |
| | | if (temp != null) |
| | | { |
| | | if (temp.value != "0") |
| | | { |
| | | temp.value = "0"; |
| | | } |
| | | btnBrightnessText.Text = FunctionList.List.GetValueText(temp.key, temp.value); |
| | | } |
| | | }; |
| | | |
| | | } |