| | |
| | | /// </summary> |
| | | List<ArmDiyView> armDiyViewList = new List<ArmDiyView>(); |
| | | |
| | | |
| | | Action refreshAction = null; |
| | | |
| | | public ArmCenterPage(Action action) |
| | | { |
| | | refreshAction = action; |
| | | bodyView = this; |
| | | } |
| | | public ArmCenterPage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadPage() |
| | | public void LoadPage(bool addNav = true) |
| | | { |
| | | Action skipAction = () => { |
| | | |
| | | }; |
| | | |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction); |
| | | |
| | | if (addNav) |
| | | { |
| | | new TopViewDiv(bodyView, Language.StringByID(StringId.SecurityCenter)).LoadTopView_ArmCenter(skipAction); |
| | | } |
| | | VerticalScrolViewLayout contentView = new VerticalScrolViewLayout() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | Y = addNav? Application.GetRealHeight(64):0, |
| | | Height = Application.GetRealHeight(667 - 64), |
| | | BackgroundColor = CSS_Color.MainBackgroundColor, |
| | | ScrollEnabled = false, |
| | |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextAlignment = TextAlignment.Center, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | Text = "撤防", |
| | | TextID = StringId.chefang,// = "撤防", |
| | | Radius = (uint)Application.GetRealWidth(20), |
| | | Gravity = Gravity.CenterHorizontal, |
| | | }; |
| | | disarmView.AddChidren(btnDisarm); |
| | | |
| | | btnDisarm.MouseUpEventHandler = (sender, e) => { |
| | | //foreach (var temp in FunctionList.List.securities) |
| | | //{ |
| | | // if (temp.status == "enable") |
| | | // { |
| | | // Control.Ins.ControlSecurity(temp, "disable"); |
| | | // break; |
| | | // } |
| | | //} |
| | | if(InDefenseMode!= null) |
| | | { |
| | | Control.Ins.ControlSecurity(InDefenseMode, "disable"); |
| | |
| | | { |
| | | Height = Application.GetRealHeight(20), |
| | | }); |
| | | |
| | | |
| | | |
| | | #region 固定布防区域 |
| | | /* |
| | |
| | | Width = Application.GetRealWidth(24), |
| | | }); |
| | | |
| | | #endregion |
| | | |
| | | |
| | | //灾害报警 |
| | | var disasterAlarmView = new FixedArmView("FunctionIcon/ArmCenter/DisasterAlarmIcon.png", Language.StringByID(StringId.DisasterDefense), Language.StringByID(StringId.Defense24Hour)); |
| | | EventHandler<MouseEventArgs> disasterAlarmViewClick = (sender, e) => { |
| | | var disasterAlarm = FunctionList.List.securities.Find((obj) => obj.type == "all_day"); |
| | | if (disasterAlarm == null) |
| | | { |
| | | disasterAlarm = new SecurityAlarm() { name = "alldaydefense", type = "all_day" }; |
| | | } |
| | | else |
| | | { |
| | | disasterAlarm = disasterAlarm.RefeshData(); |
| | | } |
| | | var addDefensePage = new AddAlarmDeploymentPage(disasterAlarm, null); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(Language.StringByID(StringId.DisasterDefense)); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | disasterAlarmView.SetClick(disasterAlarmViewClick); |
| | | fixedDeploymentTypeView.AddChidren(disasterAlarmView); |
| | | |
| | | fixedDeploymentTypeView.AddChidren(new Button() |
| | |
| | | |
| | | //防盗报警 |
| | | var burglarAlarmView = new FixedArmView("FunctionIcon/ArmCenter/BurglarAlarmIcon.png", Language.StringByID(StringId.BurglarAlarm), Language.StringByID(StringId.AlarmMute)); |
| | | EventHandler<MouseEventArgs> burglarAlarmViewClick = (sender, e) => { |
| | | var burglarAlarm = FunctionList.List.securities.Find((obj) => obj.type == "mute"); |
| | | if (burglarAlarm == null) |
| | | { |
| | | burglarAlarm = new SecurityAlarm() { name = "mutedefense", type = "mute" }; |
| | | } |
| | | else |
| | | { |
| | | burglarAlarm = burglarAlarm.RefeshData(); |
| | | } |
| | | var addDefensePage = new AddAlarmDeploymentPage(burglarAlarm, null); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(Language.StringByID(StringId.BurglarAlarm)); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | | disasterAlarmView.SetClick(disasterAlarmViewClick); |
| | | fixedDeploymentTypeView.AddChidren(burglarAlarmView); |
| | | */ |
| | | #endregion |
| | |
| | | customDeploymentView.AddChidren(view); |
| | | EventHandler<MouseEventArgs> event1 = (sender, e) => |
| | | { |
| | | Action refreshAction = () => |
| | | Action addDefenseRefreshAction = () => |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | |
| | | var addDefensePage = new AddAlarmDeploymentPage(new SecurityAlarm(), refreshAction); |
| | | var addDefensePage = new AddAlarmDeploymentPage(new SecurityAlarm(), addDefenseRefreshAction); |
| | | MainPage.BasePageView.AddChidren(addDefensePage); |
| | | addDefensePage.LoadPage(); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | |
| | | { |
| | | iniCustomDeploymentView(); |
| | | }; |
| | | |
| | | alarm = alarm.RefeshData(); |
| | | var armSetPage = new AddAlarmDeploymentPage(alarm,refreshAction); |
| | | MainPage.BasePageView.AddChidren(armSetPage); |
| | | armSetPage.LoadPage(); |
| | |
| | | { |
| | | if (bodyView != null) |
| | | { |
| | | bodyView.refreshAction?.Invoke(); |
| | | |
| | | //布防 |
| | | if (updataTemp.status == "enable") |
| | | { |
| | |
| | | /// </summary> |
| | | public class FixedArmView : FrameLayout |
| | | { |
| | | Button btnIcon; |
| | | Button btnTitle; |
| | | Button btnTitleTip; |
| | | |
| | | /// <summary> |
| | | /// 固定布防控件 |
| | | /// </summary> |
| | |
| | | this.BorderColor = CSS_Color.MainColor; |
| | | this.BorderWidth = 1; |
| | | |
| | | var btnIcon = new Button() |
| | | btnIcon = new Button() |
| | | { |
| | | X = Application.GetRealWidth(15), |
| | | Width = Application.GetRealWidth(24), |
| | |
| | | }; |
| | | this.AddChidren(btnIcon); |
| | | |
| | | var btnTitle = new Button() |
| | | btnTitle = new Button() |
| | | { |
| | | X = Application.GetRealWidth(55), |
| | | Width = Application.GetRealWidth(89), |
| | |
| | | }; |
| | | this.AddChidren(btnTitle); |
| | | |
| | | var btnTitleTip = new Button() |
| | | btnTitleTip = new Button() |
| | | { |
| | | X = Application.GetRealWidth(55), |
| | | Y = Application.GetRealHeight(23), |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.PromptFontSize_FirstLevel, |
| | | Text = titleTip, |
| | | IsMoreLines = true, |
| | | }; |
| | | this.AddChidren(btnTitleTip); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置点击事件 |
| | | /// </summary> |
| | | /// <param name="handler"></param> |
| | | public void SetClick(EventHandler<MouseEventArgs> handler) |
| | | { |
| | | btnTitleTip.MouseUpEventHandler = btnIcon.MouseUpEventHandler = handler; |
| | | } |
| | | } |
| | | |
| | | } |