New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.Safety
|
| | | {
|
| | | /// <summary>
|
| | | /// 各防区的设置内容的菜单界面
|
| | | /// </summary>
|
| | | public class GarrisonAreaSettionMenuForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 防区ID
|
| | | /// </summary>
|
| | | private int zoonID = 0;
|
| | | /// <summary>
|
| | | /// 防区名字
|
| | | /// </summary>
|
| | | private string SectorsName = string.Empty;
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="i_SectorsName">防区名字</param>
|
| | | /// <param name="i_zoonID">防区ID</param>
|
| | | public void ShowForm(string i_SectorsName, int i_zoonID) |
| | | { |
| | | this.zoonID = i_zoonID; |
| | | this.SectorsName = i_SectorsName; |
| | | |
| | | //设置头部信息 |
| | | base.SetTitleText(SectorsName); |
| | | |
| | | //初始化中部信息 |
| | | this.InitMiddleFrame(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化中部信息 |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | { |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | var listView = new VerticalListControl(29);
|
| | | listView.Y = Application.GetRealHeight(-6);
|
| | | listView.Height = zoonID == 3 ? Application.GetRealHeight(639) : Application.GetRealHeight(481);
|
| | | listView.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(listView); |
| | | |
| | | //初始化【传感器设置】行 |
| | | var row1 = new FrameRowControl(listView.rowSpace / 2); |
| | | listView.AddChidren(row1); |
| | | row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uSensorSettion), 500); |
| | | row1.AddRightArrow(); |
| | | row1.AddBottomLine(); |
| | | row1.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GarrisonAreaExistSensorForm();
|
| | | form.AddForm(this.SectorsName, this.zoonID);
|
| | | };
|
| | |
|
| | | //初始化【报警目标设置】行
|
| | | var row2 = new FrameRowControl(listView.rowSpace / 2); |
| | | listView.AddChidren(row2); |
| | | row2.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAlarmTargetSettion), 500); |
| | | row2.AddRightArrow(); |
| | | row2.AddBottomLine(); |
| | | row2.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new AlarmTargetExistSettionForm();
|
| | | form.AddForm(this.zoonID);
|
| | | }; |
| | | |
| | | //出入防区的时候才显示 |
| | | if (zoonID == 3)
|
| | | {
|
| | | //初始化【延时设置】行
|
| | | var row3 = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(row3);
|
| | | row3.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDelayedSettion), 500);
|
| | | row3.AddRightArrow();
|
| | | row3.AddBottomLine();
|
| | | row3.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GarrisonAreaDelayedSettionForm();
|
| | | form.AddForm();
|
| | | };
|
| | | }
|
| | |
|
| | | //初始化【信息通知】的行
|
| | | var row4 = new FrameRowControl(listView.rowSpace / 2);
|
| | | row4.UseClickStatu = false;
|
| | | listView.AddChidren(row4);
|
| | | row4.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uInformationPush), 500);
|
| | | //开关图标
|
| | | var btnSwicth = row4.AddMostRightSwitchIcon();
|
| | | btnSwicth.IsSelected = HdlSafeguardLogic.Current.GetGarrisonInformationPushStatu(this.zoonID) == 0;
|
| | | btnSwicth.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //设置信息通知的状态
|
| | | this.SetInformationPush(btnSwicth);
|
| | | }; |
| | | |
| | | //初始化提示信息 |
| | | this.InitTipControl(); |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 设置信息推送的状态_________________
|
| | |
|
| | | /// <summary>
|
| | | /// 设置信息推送的状态
|
| | | /// </summary>
|
| | | /// <param name="btnswich"></param>
|
| | | private async void SetInformationPush(MostRightIconControl btnswich)
|
| | | {
|
| | | //获取状态(取反)
|
| | | int statu = btnswich.IsSelected == true ? 1 : 0;
|
| | |
|
| | | //执行修改
|
| | | var result = await HdlSafeguardLogic.Current.SetGarrisonInformationPushStatu(this.zoonID, statu);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | btnswich.IsSelected = !btnswich.IsSelected;
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化提示信息_____________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化提示信息
|
| | | /// </summary>
|
| | | private void InitTipControl()
|
| | | {
|
| | | var btnIcon = new IconViewControl(58);
|
| | | btnIcon.Y = Application.GetRealHeight(1426);
|
| | | btnIcon.UnSelectedImagePath = "Item/Tips.png";
|
| | | bodyFrameLayout.AddChidren(btnIcon);
|
| | |
|
| | | int XX = 0;
|
| | | int contrWidth = 0;
|
| | |
|
| | | string msg = string.Empty;
|
| | | //24小时防区
|
| | | if (zoonID == 1)
|
| | | {
|
| | | //24小时防区不受布防、撤防影响{0}防区被触发立即报警{0}一般设置烟雾、燃气、水浸等传感器
|
| | | msg = Language.StringByID(R.MyInternationalizationString.u24HourSectorsTipMsg);
|
| | | btnIcon.X = Application.GetRealWidth(233);
|
| | | XX = Application.GetRealWidth(282);
|
| | | contrWidth = Application.GetRealWidth(580);
|
| | | }
|
| | | //静音防区
|
| | | else if (zoonID == 2)
|
| | | {
|
| | | //静音防区不受布防、撤防影响,防区被{0}触发立即报警,通常不产生声音或{0}其他提示,只发送信息到特定的接收者
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uMuteSectorsTipMsg);
|
| | | btnIcon.X = Application.GetRealWidth(202);
|
| | | XX = Application.GetRealWidth(279);
|
| | | contrWidth = Application.GetRealWidth(614);
|
| | | }
|
| | | //内部防区
|
| | | else if (zoonID == 4)
|
| | | {
|
| | | //在离家布防模式下,内部防区传感器触发{0}立即报警。在在家布防模式下{0}内部防区所有传感器不参与报警
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uInteriorSectorsTipMsg);
|
| | | btnIcon.X = Application.GetRealWidth(179);
|
| | | XX = Application.GetRealWidth(256);
|
| | | contrWidth = Application.GetRealWidth(651);
|
| | | }
|
| | | //周界防区
|
| | | else if (zoonID == 5)
|
| | | {
|
| | | //离家布防模式或在家布防模式下{0}周界防区传感器触发立即报警
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uPerimeterSectorsTipMsg);
|
| | | btnIcon.X = Application.GetRealWidth(239);
|
| | | XX = Application.GetRealWidth(317);
|
| | | contrWidth = Application.GetRealWidth(510);
|
| | | }
|
| | | //出入防区
|
| | | else
|
| | | {
|
| | | //在布防后系统提供一定的延迟时间。出门时{0}外出延时结束后,系统触发目标报警{0}回家时,进入延时结束后,系统触发目标报警
|
| | | msg = Language.StringByID(R.MyInternationalizationString.uInAndOutSectorsTipMsg);
|
| | | btnIcon.X = Application.GetRealWidth(156);
|
| | | XX = Application.GetRealWidth(216);
|
| | | contrWidth = Application.GetRealWidth(721);
|
| | | }
|
| | | var ArryMsg = msg.Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries);
|
| | |
|
| | | int yy = Application.GetRealHeight(1428);
|
| | | for (int i = 0; i < ArryMsg.Length; i++)
|
| | | {
|
| | | var btnTip = new NormalViewControl(contrWidth, Application.GetRealHeight(50), false);
|
| | | btnTip.TextAlignment = TextAlignment.Center;
|
| | | btnTip.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | | btnTip.TextSize = 12;
|
| | | btnTip.X = XX;
|
| | | btnTip.Y = yy;
|
| | | btnTip.Text = ArryMsg[i];
|
| | | bodyFrameLayout.AddChidren(btnTip);
|
| | |
|
| | | yy = btnTip.Bottom;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|