New file |
| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using Shared; |
| | | using Shared.Common; |
| | | using Shared.Phone; |
| | | using Shared.R; |
| | | using ZigBee.Device; |
| | | |
| | | namespace Shared.Phone.Device.Logic |
| | | { |
| | | public class DeviceTarget : FrameLayout |
| | | { |
| | | |
| | | public DeviceTarget () |
| | | { |
| | | Tag = "Logic"; |
| | | } |
| | | /// <summary> |
| | | /// 添加目标功能类 |
| | | /// </summary> |
| | | /// <param name="str1">设备界面识别字符串</param> |
| | | /// <param name="str2">场景界面识别字符串</param> |
| | | public void Show (string str1,string str2) |
| | | { |
| | | |
| | | #region 最上面的布局代码 |
| | | |
| | | TopView view = new TopView(); |
| | | this.AddChidren(view.TopRowView()); |
| | | view.toptitleNameBtn.TextID = MyInternationalizationString.addaction; |
| | | view.clickBtn.MouseDownEventHandler += (sender, e) => { RemoveFromParent(); }; |
| | | #endregion |
| | | |
| | | |
| | | var middle = new FrameLayout |
| | | { |
| | | Y = view.topRowLayout.Bottom, |
| | | Height = Application.GetRealHeight(Method.H - 184), |
| | | BackgroundColor = ZigbeeColor.Current.LogicMiddleBackgroundColor, |
| | | }; |
| | | this.AddChidren(middle); |
| | | |
| | | #region ----- 设备------ |
| | | |
| | | FunView deviceview= new FunView(); |
| | | deviceview.iconBtn.UnSelectedImagePath = "ZigeeLogic/function.png"; |
| | | deviceview.funnameBtn.TextID = MyInternationalizationString.device; |
| | | middle.AddChidren(deviceview.FunFrameView()); |
| | | deviceview.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var roomAndDeviceView = new RoomAndDeviceView(); |
| | | UserView.HomePage.Instance.AddChidren(roomAndDeviceView); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | roomAndDeviceView.IfType = str1; |
| | | roomAndDeviceView.Show(Language.StringByID(MyInternationalizationString.addaction)); |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | #region ----- 场景------ |
| | | FunView sceneview= new FunView(); |
| | | sceneview.iconBtn.UnSelectedImagePath = "ZigeeLogic/scene.png"; |
| | | sceneview.funnameBtn.TextID = MyInternationalizationString.scene; |
| | | sceneview.funFrameLayout.Y = deviceview.funFrameLayout.Bottom; |
| | | middle.AddChidren(sceneview.FunFrameView()); |
| | | sceneview.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var addScenePage = new AddScenePage(); |
| | | UserView.HomePage.Instance.AddChidren(addScenePage); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | addScenePage.Show(str2); |
| | | }; |
| | | #endregion |
| | | |
| | | #region ----- 安防模式------ |
| | | FunView securityview= new FunView(); |
| | | securityview.iconBtn.UnSelectedImagePath = "ZigeeLogic/security.png"; |
| | | securityview.funnameBtn.TextID = MyInternationalizationString.securitymode; |
| | | securityview.funFrameLayout.Y = sceneview.funFrameLayout.Bottom; |
| | | if (str1 == LogicView.IfString.Action_Logic) |
| | | { ///联动事件输出-不支持安防模式 |
| | | ///自动化输出-支持安防模式 |
| | | middle.AddChidren(securityview.FunFrameView()); |
| | | } |
| | | else |
| | | { |
| | | ///改变最后功能快线条颜色 |
| | | sceneview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; |
| | | } |
| | | securityview.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var securityMode = new SecurityMode(); |
| | | UserView.HomePage.Instance.AddChidren(securityMode); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | securityMode.Show(); |
| | | }; |
| | | |
| | | #endregion |
| | | |
| | | #region ----- 延时------ |
| | | |
| | | FunView delayedview = new FunView(); |
| | | delayedview.iconBtn.UnSelectedImagePath = "ZigeeLogic/delay.png"; |
| | | delayedview.funnameBtn.TextID = MyInternationalizationString.delayed; |
| | | delayedview.funFrameLayout.Y = securityview.funFrameLayout.Bottom; |
| | | delayedview.funFrameLayout.Height = Application.GetRealHeight(160 + 20);//最后一行增加20高度; |
| | | delayedview.lineBtn.BackgroundColor = ZigbeeColor.Current.LogicBlankBackgroundColor; ///改变最后功能快线条颜色 |
| | | if (str1 == LogicView.IfString.Action_Logic) |
| | | { |
| | | ///联动事件输出-不支持延时 |
| | | ///自动化输出-支持延时 |
| | | middle.AddChidren(delayedview.FunFrameView()); |
| | | } |
| | | delayedview.clickviewBtn.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | var delayTime = new DelayTime(); |
| | | UserView.HomePage.Instance.AddChidren(delayTime); |
| | | UserView.HomePage.Instance.PageIndex += 1; |
| | | delayTime.Show(); |
| | | }; |
| | | |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | } |
| | | } |