From c05a93ddb0714a310a31574aaf030e677d9a07b6 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期五, 06 一月 2023 17:43:31 +0800 Subject: [PATCH] 增加多网关绑定支持 --- Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserDeviceToScene.cs | 16 +++++++++++----- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserDeviceToScene.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserDeviceToScene.cs index 4975ee1..4f3d5e5 100644 --- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserDeviceToScene.cs +++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Scene/UserDeviceToScene.cs @@ -264,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 (); }; }; -- Gitblit v1.8.0