From 49248e3bdff0458f8f6f4156d1425bd6f6074e32 Mon Sep 17 00:00:00 2001 From: lss <lsc@hdlchina.com.cn> Date: 星期二, 17 五月 2022 13:17:21 +0800 Subject: [PATCH] Merge branch 'dev' into lss --- HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs | 94 ++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 84 insertions(+), 10 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs b/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs index 190b378..d93b021 100644 --- a/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs +++ b/HDL_ON/UI/UI2/FuntionControlView/Electrical/ClothesHangerPage.cs @@ -125,10 +125,17 @@ FrameWhiteCentet1.AddChidren(btnDown); #region 鎺у埗 - btnUp.MouseDownEventHandler = (sender, e) => { - btnUp.IsSelected = true; - }; btnUp.MouseUpEventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -143,10 +150,17 @@ Control.Ins.SendWriteCommand(device, d); }; //---- - btnStop.MouseDownEventHandler = (sender, e) => { - btnStop.IsSelected = true; - }; btnStop.MouseUpEventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -160,11 +174,31 @@ d.Add(FunctionAttributeKey.Position, "stop"); Control.Ins.SendWriteCommand(device, d); }; - //----- - btnDown.MouseDownEventHandler = (sender, e) => { - btnDown.IsSelected = true; - }; + if (!device.online) + { + btnUp.MouseDownEventHandler = (sender, e) => { + btnUp.IsSelected = true; + }; + btnStop.MouseDownEventHandler = (sender, e) => { + btnStop.IsSelected = true; + }; + //----- + btnDown.MouseDownEventHandler = (sender, e) => + { + btnDown.IsSelected = true; + }; + } btnDown.MouseUpEventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } new System.Threading.Thread(() => { System.Threading.Thread.Sleep(2000); @@ -208,6 +242,16 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } string onoff = hotDryView.Lighting ? "false" : "true"; device.SetAttrState(FunctionAttributeKey.HotDry, onoff); Dictionary<string, string> d = new Dictionary<string, string>(); @@ -237,6 +281,16 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } string onoff = windDryView.Lighting ? "false" : "true"; device.SetAttrState(FunctionAttributeKey.WindDry, onoff); Dictionary<string, string> d = new Dictionary<string, string>(); @@ -272,6 +326,16 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } string onoff = disinfectView.Lighting ? "false" : "true"; device.SetAttrState(FunctionAttributeKey.Disinfect, onoff); Dictionary<string, string> d = new Dictionary<string, string>(); @@ -312,6 +376,16 @@ EventHandler<MouseEventArgs> eventHandler = (sender, e) => { + if (!device.online) + { + new Tip() + { + CloseTime = 1, + Text = Language.StringByID(StringId.DeviceOfflineCannotOption), + Direction = AMPopTipDirection.None, + }.Show(MainPage.BaseView); + return; + } string onoff = lightingView.Lighting ? "off" : "on"; device.SetAttrState(FunctionAttributeKey.OnOff, onoff); Dictionary<string, string> d = new Dictionary<string, string>(); -- Gitblit v1.8.0