| | |
| | | using Shared.Common; |
| | | using Shared.R; |
| | | using Shared; |
| | | using Shared.Phone.UserCenter.DoorLock; |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | public class SoneLogicList : FrameLayout |
| | | { |
| | | |
| | | public static SoneLogicList soneLogicList; |
| | | public SoneLogicList() |
| | | { |
| | |
| | | |
| | | public async void Show() |
| | | { |
| | | |
| | | #region 界面的布局代码 |
| | | UserView.HomePage.Instance.ScrollEnabled = false;//锁住左滑 |
| | | TopView view = new TopView(); |
| | |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => |
| | | { |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | if (updateThread != null && updateThread.IsAlive) |
| | | { |
| | | updateThread.Abort(); |
| | | } |
| | | //把静态变量的这个东西置空 |
| | | soneLogicList = null; |
| | | this.RemoveFromParent(); |
| | |
| | | |
| | | button1.MouseUpEventHandler = async (sender, e) => |
| | | { |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.DelNormallyOpenMode(Send.CurrentDoorLock); |
| | | if (result)
|
| | | { |
| | |
| | | { |
| | | LogicView.TipView.ShowFlashTip(Language.StringByID(MyInternationalizationString.closeFailed)); |
| | | } |
| | | } |
| | | catch { } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | }); |
| | | } |
| | | }; |
| | | if (logic != null) |
| | | { |
| | |
| | | button2.TextSize = 15; |
| | | button2.TextColor = ZigbeeColor.Current.LogicTextBlackColor; |
| | | ///有时效性常开才显示时间条件文本 |
| | | } |
| | | else |
| | | { |
| | | button2.Width = Application.GetRealWidth(0); |
| | | button2.Height = Application.GetRealHeight(0); |
| | | } |
| | | ///时效性常开只有一个条件; |
| | | try |
| | | { |
| | | |
| | | var y = DateTime.Now.Year.ToString();//那一年 |
| | | var m = DateTime.Now.Month.ToString();//那一月 |
| | | var d = DateTime.Now.ToString("dd");//那一天 |
| | |
| | | string text5 = Language.StringByID(MyInternationalizationString.executeSone); |
| | | button2.Text = text1 + y + text2 + m + text3 + days.ToString() + text4 + hour.ToString() + text5; |
| | | } |
| | | catch { } |
| | | else { |
| | | button2.Y = Application.GetRealHeight(0); |
| | | button2.X = Application.GetRealWidth(0); |
| | | button2.Width = Application.GetRealWidth(0); |
| | | button2.Height = Application.GetRealHeight(0); |
| | | } |
| | | |
| | | |
| | | } |
| | | else |
| | |
| | | button2.UnSelectedImagePath = "ZigeeLogic/nextIconSone.png"; |
| | | button2.TextSize = 15; |
| | | button2.TextColor = ZigbeeColor.Current.LogicTextBlackColor; |
| | | button2.Text =""; |
| | | button2.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | |
| | |
| | | {///再次确认 |
| | | LogicView.TipView.ShowInputTip(true, async (str) => |
| | | {///确认发送命令 |
| | | CommonPage.Loading.Start(); |
| | | try |
| | | { |
| | | ///xm |
| | | |
| | | var result = await UserCenter.DoorLock.DoorLockCommonInfo.SetNormallyOpenModeFuncAsync(Send.CurrentDoorLock); |
| | | if (!result) |
| | | { |
| | |
| | | Send.CurrentDoorLock.IsDoorLockNormallyMode = true; |
| | | ModeView(); |
| | | |
| | | |
| | | } |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | CommonPage.Loading.Hide(); |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | //public static Action<bool> action1=DoorLockCommonInfo.LogicAction; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 定时更新常开模式(防止通过门锁关闭没及时刷新状态) |
| | | /// </summary> |
| | | System.Threading.Thread updateThread; |
| | | public void UpdateModeIcon() |
| | | { |
| | | updateThread = new System.Threading.Thread(() => |
| | | { |
| | | while (this.Parent != null) |
| | | { |
| | | System.Threading.Thread.Sleep(1000); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | try |
| | | { |
| | | ModeView(); |
| | | } |
| | | catch { } |
| | | |
| | | }); |
| | | } |
| | | }); |
| | | updateThread.Start(); |
| | | } |
| | | //System.Threading.Thread updateThread; |
| | | //public void UpdateModeIcon() |
| | | //{ |
| | | // updateThread = new System.Threading.Thread(() => |
| | | // { |
| | | // while (this.Parent != null) |
| | | // { |
| | | // System.Threading.Thread.Sleep(1000); |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // try |
| | | // { |
| | | // ModeView(); |
| | | // } |
| | | // catch { } |
| | | // }); |
| | | // } |
| | | // }); |
| | | // updateThread.Start(); |
| | | //} |
| | | |
| | | |
| | | } |