| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using HDL_ON.DAL.Server; |
| | | using HDL_ON.Entity; |
| | | using HDL_ON.UI.CSS; |
| | | using HDL_ON.UI.UI2.Intelligence.Automation; |
| | |
| | | { |
| | | Y = Application.GetRealHeight(74), |
| | | Height = Application.GetRealHeight(667-80), |
| | | ScrollEnabled = false, |
| | | }; |
| | | bodyView.AddChidren(contentView); |
| | | |
| | |
| | | var temp = scene.functions.Find((obj) => obj.sid == logicSid); |
| | | if (temp != null) |
| | | { |
| | | temp.status.Clear(); |
| | | var kv = temp.status.Find((obj) => obj.key == "enable"); |
| | | if (kv != null) |
| | | { |
| | | kv.value = "true"; |
| | | } |
| | | else |
| | | { |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "true", |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.sid = logicSid; |
| | | scene.functions.Add(temp); |
| | | } |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "true" |
| | | }); |
| | | scene.functions.Add(temp); |
| | | } |
| | | if (scene.userSceneId != null) |
| | | { |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var code = scene.EditScene(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (code == "0") |
| | | { |
| | | refreshAction(); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(code); |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | refreshAction(); |
| | | } |
| | | }; |
| | | btnOff.MouseUpEventHandler = (sender, e) => |
| | | { |
| | |
| | | var temp = scene.functions.Find((obj) => obj.sid == logicSid); |
| | | if (temp != null) |
| | | { |
| | | temp.status.Clear(); |
| | | var kv = temp.status.Find((obj) => obj.key == "enable"); |
| | | if (kv != null) |
| | | { |
| | | kv.value = "false"; |
| | | } |
| | | else |
| | | { |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "false", |
| | | }); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | temp = new SceneFunction(); |
| | | temp.type = "7"; |
| | | temp.sid = logicSid; |
| | | scene.functions.Add(temp); |
| | | } |
| | | temp.status.Add(new SceneFunctionStatus() |
| | | { |
| | | key = "enable", |
| | | value = "false" |
| | | }); |
| | | scene.functions.Add(temp); |
| | | } |
| | | |
| | | if (scene.userSceneId != null) |
| | | { |
| | | var waitPage = new Loading(); |
| | | bodyView.AddChidren(waitPage); |
| | | waitPage.Start(""); |
| | | new System.Threading.Thread(() => { |
| | | try |
| | | { |
| | | var code = scene.EditScene(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | if (code == "0") |
| | | { |
| | | refreshAction(); |
| | | } |
| | | else |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(code); |
| | | } |
| | | }); |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | if (waitPage != null) |
| | | { |
| | | waitPage.RemoveFromParent(); |
| | | waitPage = null; |
| | | } |
| | | }); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | else |
| | | { |
| | | refreshAction(); |
| | | } |
| | | }; |
| | | |
| | | } |