| | |
| | | }; |
| | | FrameWhiteCentet1.AddChidren(btnDown); |
| | | |
| | | #region 控制 |
| | | btnUp.MouseDownEventHandler = (sender, e) => { |
| | | btnUp.IsSelected = true; |
| | | }; |
| | | btnUp.MouseUpEventHandler = (sender, e) => { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnUp.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Position, "up"); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | //---- |
| | | btnStop.MouseDownEventHandler = (sender, e) => { |
| | | btnStop.IsSelected = true; |
| | | }; |
| | | btnStop.MouseUpEventHandler = (sender, e) => { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnStop.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Position, "stop"); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | //----- |
| | | btnDown.MouseDownEventHandler = (sender, e) => { |
| | | btnDown.IsSelected = true; |
| | | }; |
| | | btnDown.MouseUpEventHandler = (sender, e) => { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | System.Threading.Thread.Sleep(2000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnDown.IsSelected = false; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | | d.Add(FunctionAttributeKey.Position, "down"); |
| | | Control.Ins.SendWriteCommand(device, d); |
| | | }; |
| | | #endregion |
| | | |
| | | #endregion |
| | | |
| | | #region 菜单 |
| | |
| | | { |
| | | FrameWhiteCentet1.AddChidren(hotDryView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | string onoff = hotDryView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.HotDry, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | } |
| | | FrameWhiteCentet1.AddChidren(windDryView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | string onoff = windDryView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.WindDry, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | } |
| | | FrameWhiteCentet1.AddChidren(disinfectView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | string onoff = disinfectView.Lighting ? "false" : "true"; |
| | | device.SetAttrState(FunctionAttributeKey.Disinfect, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | if(index >2) |
| | | { |
| | | lightingView.Y = Application.GetRealHeight(409); |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | lightingView.Y = Application.GetRealHeight(304); |
| | | if (index == 1) |
| | |
| | | } |
| | | FrameWhiteCentet1.AddChidren(lightingView); |
| | | |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | string onoff = lightingView.Lighting ? "off" : "on"; |
| | | device.SetAttrState(FunctionAttributeKey.OnOff, onoff); |
| | | Dictionary<string, string> d = new Dictionary<string, string>(); |
| | |
| | | /// </summary> |
| | | private void RefreshFormStatu() |
| | | { |
| | | Application.RunOnMainThread(() => { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnIcon.IsSelected = true; |
| | | #region 点亮文本 |
| | | var hotDryTemp = device.status.Find((sta) => sta.key == FunctionAttributeKey.HotDry); |
| | |
| | | leftTime *= 60; |
| | | if (countdownThread == null) |
| | | { |
| | | countdownThread = new System.Threading.Thread(() => { |
| | | countdownThread = new System.Threading.Thread(() => |
| | | { |
| | | while(true) |
| | | { |
| | | if(leftTime > 1) |
| | |
| | | }); |
| | | System.Threading.Thread.Sleep(1000); |
| | | leftTime--; |
| | | }else |
| | | } |
| | | else |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | }); |
| | | } |
| | | } |
| | | }) { IsBackground = true }; |
| | | }) |
| | | { IsBackground = true }; |
| | | countdownThread.Start(); |
| | | } |
| | | } |
| | |
| | | public void SetViewStatus(bool state) |
| | | { |
| | | btnIcon.IsSelected = btnTitle.IsSelected = btnTime.IsSelected = Lighting = state; |
| | | } |
| | | |
| | | public bool GetViewState() |
| | | { |
| | | return Lighting; |
| | | } |
| | | |
| | | /// <summary> |