old mode 100755
new mode 100644
| | |
| | | using System; |
| | | using Shared.Common; |
| | | using Shared.Phone.Device.CommonForm; |
| | | using Shared.Phone.Device.DeviceLogic; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.Device.Light |
| | |
| | | /// MaxLevel |
| | | /// </summary> |
| | | private const int MaxLevel = 254; |
| | | |
| | | /// <summary> |
| | | /// IsDrawerLockMode |
| | | /// </summary> |
| | | public bool IsDrawerLockMode; |
| | | #endregion |
| | | |
| | | #region ◆ 接口__________________________ |
| | |
| | | { |
| | | ZbGateway.StatusList.Remove(this); |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | action(); |
| | | action = null; |
| | | //action(); |
| | | //action = null; |
| | | if (IsDrawerLockMode) |
| | | { |
| | | CommonPage.Instance.IsDrawerLockMode = false; |
| | | } |
| | | base.RemoveFromParent(); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public DimmableLightControl() |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = false; |
| | | BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor; |
| | | ZbGateway.StatusList.Add(this); |
| | | } |
| | |
| | | //发送读取状态命令 |
| | | UserView.UserHomeView.ReadStatus(dimmableLight, () => |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | dimmableLight.ReadOnOffStatus(); |
| | | dimmableLight.ReadLevel(); |
| | | ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice); |
| | | }); |
| | | } |
| | | else |
| | |
| | | //防止短时间内多次读取设备状态 |
| | | if ((DateTime.Now - dimmableLight.LastDateTime).TotalSeconds > CommonPage.ReadDeviceStatuSpan) |
| | | { |
| | | dimmableLight.ReadAttri(Cluster_ID.Identify, AttriButeId.Switch); |
| | | dimmableLight.ReadOnOffStatus(); |
| | | dimmableLight.ReadLevel(); |
| | | ReadDeviceAttributeLogic.Instance.SendDimmableLightStatuComand(device.CommonDevice); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | RemoveFromParent(); |
| | | }; |
| | | |
| | | var sharedBtn = new Button |
| | | { |
| | | X = Application.GetRealWidth(850), |
| | | Width = Application.GetMinReal(69), |
| | | Height = Application.GetMinReal(69), |
| | | Gravity = Gravity.CenterVertical, |
| | | UnSelectedImagePath = "Item/Shared.png" |
| | | }; |
| | | top.topView.AddChidren(sharedBtn); |
| | | |
| | | var moreBtn = new Button |
| | | { |
| | |
| | | //collection |
| | | if ((sender as Button).IsSelected) |
| | | { |
| | | Shared.Common.Room.GetLoveRoom().DeleteDevice(device.FileName); |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName); |
| | | (sender as Button).IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.GetLoveRoom().AddDevice(device.FileName); |
| | | Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(device.FileName); |
| | | (sender as Button).IsSelected = true; |
| | | } |
| | | } |