CrabtreeOn,印度客户定制APP,迁移2.0平台版本
1
wxr
2023-03-31 d53e6af2c5f17838fa79659614b15a2a1f383399
Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserDeviceToScene.cs
@@ -198,7 +198,6 @@
                        };
                        sceneView.AddChidren (btnSceneName);
                        var btnBGC = new Button () {
                            //UnSelectedImagePath = "Item/sss.png",
                            UnSelectedImagePath = "Item/Transparent.png",
                            SelectedImagePath = "Item/SceneSettingBackground.png",
                            TextAlignment = TextAlignment.BottomCenter,
@@ -208,15 +207,27 @@
                        };
                        sceneView.AddChidren (btnBGC);
                        btnBGC.MouseLongEventHandler += (sender, e) => {
                        var btnSetSceneIcon = new Button () {
                            UnSelectedImagePath = "Item/More2.png",
                            SelectedImagePath = "Item/Transparent.png",
                            Height = Application.GetRealHeight (50),
                            Width = Application.GetRealWidth (60),
                            X = Application.GetRealWidth (240),
                            Y = Application.GetRealHeight (10),
                        };
                        sceneView.AddChidren (btnSetSceneIcon);
                        btnSetSceneIcon.MouseUpEventHandler += (sender, e) => {//MouseLongEventHandler
                            //if (string.IsNullOrEmpty (scene.Name))
                            //    return;
                            btnSetSceneIcon.IsSelected = true;
                            LongPressFrameLayout = new FrameLayout () {
                                BackgroundColor = SkinStyle.Current.SceneTransparentBackColor,
                            };
                            sceneView.AddChidren (LongPressFrameLayout);
                            LongPressFrameLayout.MouseUpEventHandler += (sender2, e2) => {
                                LongPressFrameLayout.RemoveFromParent ();
                                btnSetSceneIcon.IsSelected = false;
                            };
                            var btnEditor = new Button () {
@@ -253,11 +264,17 @@
                            LongPressFrameLayout.AddChidren (btnDel);
                            btnDel.MouseUpEventHandler += (senderDel, eDel) => {
                                IO.FileUtils.DeleteFile (sceneFilePath);
                                sceneFilePaths.Remove (sceneFilePath);
                                sceneFilePaths.Remove ("");
                                IO.FileUtils.WriteFileByBytes (Scene.GlobalSceneFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (sceneFilePaths)));
                                InitView (isGolba);
                                Alert alert = new Alert ("", $"Are you sure to delete the scenario: {scene.Name}?", Language.StringByID (R.MyInternationalizationString.Cancel), Language.StringByID (R.MyInternationalizationString.Confrim));
                                alert.ResultEventHandler += (sender2, e2) => {
                                    if (e2) {
                                        IO.FileUtils.DeleteFile (sceneFilePath);
                                        sceneFilePaths.Remove (sceneFilePath);
                                        sceneFilePaths.Remove ("");
                                        IO.FileUtils.WriteFileByBytes (Scene.GlobalSceneFilePath, System.Text.Encoding.UTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (sceneFilePaths)));
                                        InitView (isGolba);
                                    }
                                };
                                alert.Show ();
                            };
                        };