From 452e8cef1c740d18ee398be6971d9952e41dbd4a Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期三, 12 四月 2023 16:11:50 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs | 65 ++++++++++++++++++++++++++++++++
1 files changed, 64 insertions(+), 1 deletions(-)
diff --git a/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs b/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs
index 37b83e8..024d8d6 100644
--- a/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs
+++ b/HDL_ON/UI/UI2/2-Classification/SceneControlZone.cs
@@ -1,6 +1,7 @@
锘縰sing System;
using System.Collections.Generic;
using System.Threading;
+using HDL_ON.Common;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI.CSS;
@@ -128,7 +129,6 @@
{
if (scene.functions.Count == 0)
{
-
var waitPage = new Loading();
new Thread(() =>
{
@@ -206,6 +206,69 @@
btnName.MouseUpEventHandler = upEvent;
btnFromFloor.MouseUpEventHandler = upEvent;
this.MouseUpEventHandler = upEvent;
+
+
+ EventHandler<MouseEventArgs> delEvent = (sender, e) => {
+ Action action = () =>{
+ var waitPage = new Loading();
+ MainPage.BaseView.AddChidren(waitPage);
+ waitPage.Start("");
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var pm = new HttpServerRequest();
+ var packCode = pm.DeleteScene(scene.userSceneId);
+ if (packCode == StateCode.SUCCESS)
+ {
+ FileUtlis.Files.DeleteFile(scene.savePath);
+ try
+ {
+ foreach (var sss in FunctionList.List.scenes)
+ {
+ if (sss.userSceneId == scene.userSceneId)
+ {
+ FunctionList.List.scenes.Remove(sss);
+ break;
+ }
+ }
+ }
+ catch { }
+ Application.RunOnMainThread(() =>
+ {
+ this.RemoveFromParent();
+ });
+ }
+ else
+ {
+ Application.RunOnMainThread(() =>
+ {
+ IMessageCommon.Current.ShowErrorInfoAlter(packCode);
+ });
+ }
+ }
+ catch { }
+ finally
+ {
+ Application.RunOnMainThread(() => {
+ if(waitPage!= null)
+ {
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+
+
+ };
+ new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.DoYouWantDelCombinedDimming, action);
+ };
+ btnName.MouseLongEventHandler = delEvent;
+ btnFromFloor.MouseLongEventHandler = delEvent;
+ this.MouseLongEventHandler = delEvent;
+
}
else
{
--
Gitblit v1.8.0