| | |
| | | /// <summary>
|
| | | /// 各防区的设置内容的菜单界面
|
| | | /// </summary>
|
| | | public class SectorsSettionMenuForm : UserCenterCommonForm
|
| | | public class SectorsSettionMenuForm : EditorCommonForm
|
| | | {
|
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalScrolViewLayout listView = null;
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 防区ID
|
| | |
| | | /// 防区名字
|
| | | /// </summary>
|
| | | private string SectorsName = string.Empty;
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | { |
| | | listView = new VerticalScrolViewLayout(); |
| | | listView.Height = bodyFrameLayout.Height; |
| | | //清空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); |
| | | |
| | | //初始化【传感器设置】行 |
| | | this.InitSensorSettionRow(); |
| | | |
| | | //初始化【报警目标设置】行 |
| | | this.InitAlarmTargetRow(); |
| | | 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 SensorDeviceSettionListForm();
|
| | | 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 AlarmTargetSettionForm();
|
| | | form.AddForm(this.zoonID);
|
| | | }; |
| | | |
| | | //出入防区的时候才显示 |
| | | if (zoonID == 3)
|
| | | {
|
| | | //初始化【延时设置】行
|
| | | this.InitDelayedSettionRow();
|
| | | } |
| | | |
| | | 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 DelayedSettionMainForm();
|
| | | form.AddForm();
|
| | | };
|
| | | }
|
| | |
|
| | | //初始化【信息通知】的行
|
| | | this.InitInformationPushRow(); |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化【传感器设置】行
|
| | | /// </summary>
|
| | | private void InitSensorSettionRow()
|
| | | {
|
| | | var rowLayout = new StatuRowLayout();
|
| | | listView.AddChidren(rowLayout);
|
| | |
|
| | | //传感器设置
|
| | | var txName = new RowCenterView(false);
|
| | | txName.TextID = R.MyInternationalizationString.uSensorSettion;
|
| | | rowLayout.AddChidren(txName);
|
| | |
|
| | | rowLayout.AddRightIconControl();
|
| | |
|
| | | rowLayout.MouseUpEvent += (sender, e) =>
|
| | | {
|
| | | var form = new SensorDeviceSettionListForm();
|
| | | //出入防区
|
| | | string title = Language.StringByID(R.MyInternationalizationString.uInAndOutSectors);
|
| | | this.AddForm(form, this.SectorsName, this.zoonID);
|
| | | };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化【报警目标设置】行
|
| | | /// </summary>
|
| | | private void InitAlarmTargetRow()
|
| | | {
|
| | | var rowLayout = new StatuRowLayout();
|
| | | listView.AddChidren(rowLayout);
|
| | |
|
| | | //报警目标设置
|
| | | var txName = new RowCenterView(false);
|
| | | txName.TextID = R.MyInternationalizationString.uAlarmTargetSettion;
|
| | | rowLayout.AddChidren(txName);
|
| | |
|
| | | rowLayout.AddRightIconControl();
|
| | |
|
| | | rowLayout.MouseUpEvent += (sender, e) =>
|
| | | {
|
| | | var form = new AlarmTargetSettionForm();
|
| | | this.AddForm(form, this.zoonID);
|
| | | };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化【延时设置】行
|
| | | /// </summary>
|
| | | private void InitDelayedSettionRow()
|
| | | {
|
| | | var rowLayout = new StatuRowLayout();
|
| | | listView.AddChidren(rowLayout);
|
| | |
|
| | | //延时设置
|
| | | var txName = new RowCenterView(false);
|
| | | txName.TextID = R.MyInternationalizationString.uDelayedSettion;
|
| | | rowLayout.AddChidren(txName);
|
| | |
|
| | | rowLayout.AddRightIconControl();
|
| | |
|
| | | rowLayout.MouseUpEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DelayedSettionMainForm();
|
| | | this.AddForm(form);
|
| | | };
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化【信息通知】的行
|
| | | /// </summary>
|
| | | /// <returns></returns>
|
| | | private void InitInformationPushRow()
|
| | | {
|
| | | var rowLayout = new RowLayout();
|
| | | rowLayout.Height = ControlCommonResourse.ListViewRowHeight;
|
| | | listView.AddChidren(rowLayout);
|
| | |
|
| | | //信息推送
|
| | | var txtMsg = new RowCenterView(false);
|
| | | rowLayout.AddChidren(txtMsg);
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uInformationPush);
|
| | | //if (this.zoonID >= 3)
|
| | | //{
|
| | | // msg += "(" + Language.StringByID(R.MyInternationalizationString.uOtherSectors) + ")";
|
| | | //}
|
| | | txtMsg.Text = msg;
|
| | |
|
| | | var row4 = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(row4);
|
| | | row4.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uInformationPush), 500);
|
| | | //开关图标
|
| | | var btnSwicth = new SwichControl();
|
| | | rowLayout.AddChidren(btnSwicth);
|
| | | btnSwicth.IsSelected = Common.LocalSafeguard.Current.GetGarrisonInformationPushStatu(this.zoonID) == 0;
|
| | | btnSwicth.MouseUpEventHandler += (sender, e) =>
|
| | | var btnSwicth = row4.AddMostRightEmptyIcon(104, 63);
|
| | | btnSwicth.UnSelectedImagePath = "Item/Switch.png";
|
| | | btnSwicth.SelectedImagePath = "Item/SwitchSelected.png";
|
| | | btnSwicth.IsSelected = HdlSafeguardLogic.Current.GetGarrisonInformationPushStatu(this.zoonID) == 0;
|
| | | btnSwicth.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //设置信息通知的状态
|
| | | this.SetInformationPush(btnSwicth);
|
| | | };
|
| | | }; |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 设置信息推送的状态_________________
|
| | |
|
| | | /// <summary>
|
| | | /// 设置信息推送的状态
|
| | | /// </summary>
|
| | | /// <param name="btnswich"></param>
|
| | | private async void SetInformationPush(SwichControl btnswich)
|
| | | private async void SetInformationPush(MostRightIconControl btnswich)
|
| | | {
|
| | | //获取状态
|
| | | int statu = Common.LocalSafeguard.Current.GetGarrisonInformationPushStatu(this.zoonID) == 0 ? 1 : 0;
|
| | | int statu = HdlSafeguardLogic.Current.GetGarrisonInformationPushStatu(this.zoonID) == 0 ? 1 : 0;
|
| | |
|
| | | //执行修改
|
| | | var result = await Common.LocalSafeguard.Current.SetGarrisonInformationPushStatu(this.zoonID, statu);
|
| | | var result = await HdlSafeguardLogic.Current.SetGarrisonInformationPushStatu(this.zoonID, statu);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | btnswich.IsSelected = !btnswich.IsSelected;
|
| | | if (btnswich != null)
|
| | | {
|
| | | btnswich.IsSelected = !btnswich.IsSelected;
|
| | | }
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|