| | |
| | | using System; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | using Shared.Common; |
| | |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | |
| | | public class AddLogicPage : FrameLayout |
| | | { |
| | | public AddLogicPage () |
| | | public AddLogicPage() |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.LogicTopBackgroundColor, |
| | | Height = Application.GetRealHeight(184), |
| | | LineColor= ZigbeeColor.Current.LogicRowLayoutTopLineColor, |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutTopLineColor, |
| | | }; |
| | | this.AddChidren(topRowLayout); |
| | | |
| | | var titleName = new Button { |
| | | TextSize = 16, |
| | | TextSize = 17, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | X = Application.GetRealWidth(176), |
| | | Width = Application.GetRealWidth(400), |
| | | Width = Application.GetRealWidth(600), |
| | | Height = Application.GetRealHeight(69), |
| | | Y = Application.GetRealHeight(92), |
| | | TextID = MyInternationalizationString.selection, |
| | |
| | | var clickBtn = new Button |
| | | { |
| | | Width = Application.GetRealWidth(81 + 51), |
| | | Height = Application.GetRealHeight(58+40), |
| | | Y = Application.GetRealHeight(98-40), |
| | | Height = Application.GetRealHeight(58 + 40), |
| | | Y = Application.GetRealHeight(98 - 40), |
| | | }; |
| | | topRowLayout.AddChidren(clickBtn); |
| | | clickBtn.MouseDownEventHandler += (sender, e) => |
| | |
| | | //Gravity = Gravity.CenterVertical; |
| | | UnSelectedImagePath = "ZigeeLogic/back.png", |
| | | }; |
| | | topRowLayout.AddChidren (back); |
| | | topRowLayout.AddChidren(back); |
| | | back.MouseDownEventHandler += (sender, e) => { |
| | | RemoveFromParent (); |
| | | RemoveFromParent(); |
| | | }; |
| | | #endregion |
| | | |
| | | #region 最下面的布局代码 |
| | | var middle = new FrameLayout { |
| | | Y=topRowLayout.Bottom, |
| | | Height=Application.GetRealHeight(1920-184), |
| | | Y = topRowLayout.Bottom, |
| | | Height = Application.GetRealHeight(1920 - 184), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren (middle); |
| | | this.AddChidren(middle); |
| | | |
| | | #region ----时间条件---- |
| | | var timeframelayout= new FrameLayout |
| | | var timeframelayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | |
| | | Width = Application.GetRealWidth(850), |
| | | Height = Application.GetRealHeight(130), |
| | | X = Application.GetRealWidth(176), |
| | | LineColor= ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | LineColor = ZigbeeColor.Current.LogicRowLayoutLineColor, |
| | | }; |
| | | timeframelayout.AddChidren(timerow); |
| | | ///时间条件 |
| | | var btntime = new Button { |
| | | Text=Language.StringByID (MyInternationalizationString.timecondition), |
| | | Text = Language.StringByID(MyInternationalizationString.timecondition), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize=15, |
| | | }; |
| | | timerow.AddChidren (btntime); |
| | | timerow.AddChidren(btntime); |
| | | |
| | | var btntimeback = new Button { |
| | | Width = Application.GetRealWidth(58), |
| | |
| | | X = Application.GetRealWidth(789), |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | timerow.AddChidren (btntimeback); |
| | | timerow.AddChidren(btntimeback); |
| | | |
| | | EventHandler<MouseEventArgs> timeclick = (sender, e) => |
| | | { |
| | |
| | | BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor, |
| | | Y = timeframelayout.Bottom, |
| | | }; |
| | | middle.AddChidren (deviceframelayout); |
| | | middle.AddChidren(deviceframelayout); |
| | | |
| | | var deviceiconBtn = new Button |
| | | { |
| | |
| | | }; |
| | | deviceframelayout.AddChidren(devicerow); |
| | | |
| | | |
| | | |
| | | ///设备状态条件 |
| | | var btndevice = new Button { |
| | | //Text = "设备状态条件", |
| | | TextID = MyInternationalizationString.device, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 15, |
| | | }; |
| | | devicerow.AddChidren (btndevice); |
| | | devicerow.AddChidren(btndevice); |
| | | |
| | | var btndeviceback = new Button { |
| | | Width = Application.GetRealWidth(58), |
| | |
| | | UnSelectedImagePath = "ZigeeLogic/next.png", |
| | | |
| | | }; |
| | | devicerow.AddChidren (btndeviceback); |
| | | devicerow.AddChidren(btndeviceback); |
| | | |
| | | EventHandler<MouseEventArgs> devicestateclick = (sender, e) => |
| | | { |
| | | Common.Logic.LogicDviceList.Clear(); |
| | | if (Common.Logic.LogicDviceList.Count == 0) |
| | | { |
| | | Common.Logic.LogicDviceList.AddRange(LocalDevice.Current.listAllDevice.ToArray()); |
| | | } |
| | | var deviceStateCondition = new DeviceStateCondition(); |
| | | UserView.HomePage.Instance.AddChidren(deviceStateCondition); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = MyInternationalizationString.security, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 15, |
| | | }; |
| | | securityrow.AddChidren(btnsecurity); |
| | | |
| | |
| | | Height = Application.GetRealHeight(58), |
| | | UnSelectedImagePath = "ZigeeLogic/next.png", |
| | | X = Application.GetRealWidth(789), |
| | | Gravity=Gravity.CenterVertical, |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | securityrow.AddChidren(btnsecurityback); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextID = MyInternationalizationString.location, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 15, |
| | | }; |
| | | locationrow.AddChidren(btnlocation); |
| | | |
| | |
| | | |
| | | #region ----已有自动化条件---- |
| | | var existencerowlayout = new RowLayout { |
| | | Height = Application.GetRealHeight (180), |
| | | Y= securityframelayout.Bottom, |
| | | Height = Application.GetRealHeight(180), |
| | | Y = securityframelayout.Bottom, |
| | | }; |
| | | //middle.AddChidren (existencerowlayout); |
| | | ///已有自动化条件 |
| | |
| | | X = Application.GetRealWidth(60), |
| | | TextID = MyInternationalizationString.automation, |
| | | TextColor = ZigbeeColor.Current.LogicTextBlackColor, |
| | | TextSize = 15, |
| | | }; |
| | | existencerowlayout.AddChidren (btnexistence); |
| | | existencerowlayout.AddChidren(btnexistence); |
| | | |
| | | var btnexistenceback = new Button { |
| | | Width = Application.GetRealWidth (110), |
| | | Height = Application.GetRealHeight (110), |
| | | Width = Application.GetRealWidth(110), |
| | | Height = Application.GetRealHeight(110), |
| | | UnSelectedImagePath = "ZigeeLogic/next.png", |
| | | SelectedImagePath = "ZigeeLogic/NextSelecte.png", |
| | | X = Application.GetRealWidth (1080 - 140), |
| | | Gravity=Gravity.CenterVertical, |
| | | X = Application.GetRealWidth(1080 - 140), |
| | | Gravity = Gravity.CenterVertical, |
| | | }; |
| | | existencerowlayout.AddChidren (btnexistenceback); |
| | | existencerowlayout.AddChidren(btnexistenceback); |
| | | |
| | | EventHandler<MouseEventArgs> logicclick = (sender, e) => { |
| | | var logicListAutomation = new LogicListAutomation (); |
| | | UserView.HomePage.Instance.AddChidren (logicListAutomation); |
| | | var logicListAutomation = new LogicListAutomation(); |
| | | UserView.HomePage.Instance.AddChidren(logicListAutomation); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicListAutomation.Show (); |
| | | logicListAutomation.Show(); |
| | | }; |
| | | btnexistenceback.MouseUpEventHandler += logicclick; |
| | | btnexistence.MouseUpEventHandler += logicclick; |
| | | existencerowlayout.MouseUpEventHandler += logicclick; |
| | | #endregion |
| | | |
| | | |
| | | |
| | | |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 安防条件View |
| | | /// </summary> |
| | |
| | | flMain.RemoveFromParent(); |
| | | }; |
| | | |
| | | var securityfra1= new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | | Height = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(1920 - 100), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | }; |
| | | flMain.AddChidren(securityfra1); |
| | | |
| | | var securityfra = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | | Height = Application.GetRealHeight(690), |
| | | Y = Application.GetRealHeight(1920-690), |
| | | Y = Application.GetRealHeight(1920 - 690), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | //Radius = (uint)Application.GetRealHeight(60), |
| | | }; |
| | | flMain.AddChidren(securityfra); |
| | | securityfra.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | #region -------取消 完成 |
| | | var timetype = new RowLayout |
| | | { |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | X = Application.GetRealWidth(80), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | }; |
| | | timetype.AddChidren(Btncancel); |
| | | Btncancel.MouseUpEventHandler += (sender16, e16) => |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | X = Btntitle.Right + Application.GetRealWidth(100), |
| | | TextSize = 14, |
| | | |
| | | }; |
| | | timetype.AddChidren(Btncomplete); |
| | |
| | | TextID = MyInternationalizationString.logicathomegarrison, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize = 14, |
| | | }; |
| | | athomedefenceRowLayout.AddChidren(btnathomedefence); |
| | | |
| | |
| | | TextID = MyInternationalizationString.logicremovehomegarrison, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize = 14, |
| | | }; |
| | | leavehomedefenceRowLayout.AddChidren(leavehomebtndefence); |
| | | var leavehomedefenceSelected = new SelectedButton(); |
| | |
| | | TextID = MyInternationalizationString.withdrawal, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize = 14, |
| | | }; |
| | | withdrawalRowLayout.AddChidren(btnwithdrawal); |
| | | var withdrawalSelected = new SelectedButton(); |
| | |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | logicCommunalPage.Show(() => { }); |
| | | }; |
| | | |
| | | |
| | | } |
| | | /// <summary> |
| | | /// 地理围栏View |
| | |
| | | flMain.RemoveFromParent(); |
| | | }; |
| | | |
| | | var Locationfra1 = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | | Height = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(1920 - 100), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | }; |
| | | flMain.AddChidren(Locationfra1); |
| | | |
| | | var Locationfra = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | | Height = Application.GetRealHeight(530), |
| | | Y = Application.GetRealHeight(1920 - 530), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | //Radius = (uint)Application.GetRealHeight(60), |
| | | }; |
| | | flMain.AddChidren(Locationfra); |
| | | |
| | | Locationfra.SetCornerWithSameRadius(20, HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight); |
| | | |
| | | #region -------取消 完成 |
| | | var typeRow = new RowLayout |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | X = Application.GetRealWidth(80), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | }; |
| | | typeRow.AddChidren(Btncancel); |
| | | Btncancel.MouseUpEventHandler += (sender16, e16) => |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | X = Btntitle.Right + Application.GetRealWidth(100), |
| | | TextSize = 14, |
| | | |
| | | }; |
| | | typeRow.AddChidren(Btncomplete); |
| | |
| | | TextID = MyInternationalizationString.athome, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize = 14, |
| | | |
| | | |
| | | }; |
| | |
| | | TextID = MyInternationalizationString.leavehome, |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | TextSize = 14, |
| | | }; |
| | | leavehomeRowLayout.AddChidren(btnleavehome); |
| | | var leavehomeSelected = new SelectedButton(); |
| | |
| | | } |
| | | LocationConditionsInfo.Add("AtHome", "1"); |
| | | } |
| | | double a1 = 23.134421, a2 = 113.267189; |
| | | double a1 = Config.Instance.Home.Latitude, a2 = Config.Instance.Home.Longitude; |
| | | //调用方法,跳转页面 |
| | | GDMapKit.Show((mLatitude, mLongitude, mRadius, name) => |
| | | { |
| | |
| | | flMain.RemoveFromParent(); |
| | | }; |
| | | |
| | | var timetypeframelayout1 = new FrameLayout |
| | | { |
| | | Width = Application.GetRealWidth(1080), |
| | | Height = Application.GetRealHeight(100), |
| | | Y = Application.GetRealHeight(1920 - 100), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | }; |
| | | flMain.AddChidren(timetypeframelayout1); |
| | | |
| | | |
| | | var timetypeframelayout = new FrameLayout |
| | | { |
| | |
| | | Height = Application.GetRealHeight(530), |
| | | Y = Application.GetRealHeight(1920 - 530), |
| | | BackgroundColor = ZigbeeColor.Current.LogicBackgroundColor, |
| | | Radius = (uint)Application.GetRealHeight(60), |
| | | // Radius = (uint)Application.GetRealHeight(60), |
| | | }; |
| | | flMain.AddChidren(timetypeframelayout); |
| | | timetypeframelayout.SetCornerWithSameRadius(20,HDLUtils.RectCornerTopLeft|HDLUtils.RectCornerTopRight); |
| | | |
| | | #region -------取消 完成 |
| | | var timetype = new RowLayout |
| | |
| | | TextColor = ZigbeeColor.Current.LogicBtnCancelColor, |
| | | Height = Application.GetRealHeight(140), |
| | | Width = Application.GetRealWidth(200), |
| | | X=Application.GetRealWidth(80), |
| | | TextAlignment=TextAlignment.CenterLeft, |
| | | X = Application.GetRealWidth(80), |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextSize = 14, |
| | | }; |
| | | timetype.AddChidren(Btncancel); |
| | | Btncancel.MouseUpEventHandler += (sender16, e16) => |
| | |
| | | UserView.HomePage.Instance.ScrollEnabled = true; |
| | | }; |
| | | |
| | | var Btntitle= new Button |
| | | var Btntitle = new Button |
| | | { |
| | | TextID = MyInternationalizationString.type, |
| | | TextColor = ZigbeeColor.Current.LogicBtnTypeColor, |
| | | Height = Application.GetRealHeight(140), |
| | | Width = Application.GetRealWidth(320), |
| | | TextAlignment = TextAlignment.Center, |
| | | X= Btncancel.Right+Application.GetRealWidth(100), |
| | | X = Btncancel.Right + Application.GetRealWidth(100), |
| | | TextSize = 16, |
| | | }; |
| | | timetype.AddChidren(Btntitle); |
| | |
| | | Width = Application.GetRealWidth(200), |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | X = Btntitle.Right + Application.GetRealWidth(100), |
| | | |
| | | TextSize = 14, |
| | | |
| | | }; |
| | | timetype.AddChidren(Btncomplete); |
| | | #endregion |
| | |
| | | var timepointFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | Y = timetype.Bottom+Application.GetRealHeight(20), |
| | | Y = timetype.Bottom + Application.GetRealHeight(20), |
| | | }; |
| | | timetypeframelayout.AddChidren(timepointFrameLayout); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | //Text="立即执行", |
| | | TextSize = 14, |
| | | }; |
| | | timerow.AddChidren(Btntimepoint); |
| | | |
| | |
| | | var timeFrameLayout = new FrameLayout |
| | | { |
| | | Height = Application.GetRealHeight(160), |
| | | Y =timepointFrameLayout.Bottom, |
| | | Y = timepointFrameLayout.Bottom, |
| | | }; |
| | | timetypeframelayout.AddChidren(timeFrameLayout); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterLeft, |
| | | TextColor = ZigbeeColor.Current.LogicBtnNotSelectedColor, |
| | | //Text = "时间范围", |
| | | TextSize = 14, |
| | | }; |
| | | time1row.AddChidren(Btntime); |
| | | |
| | |
| | | time1row.AddChidren(timeSelected); |
| | | #endregion |
| | | |
| | | |
| | | |
| | | ///立即执行点击事件 |
| | | EventHandler<MouseEventArgs> timepointclick = (sedner14, e14) => |
| | | { |
| | |
| | | } |
| | | |
| | | } |
| | | |
| | | } |