| | |
| | | /// <summary>
|
| | | /// 延时设置的主界面★
|
| | | /// </summary>
|
| | | public class DelayedSettionMainForm : UserCenterCommonForm
|
| | | public class DelayedSettionMainForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 进入延迟的时间控件
|
| | | /// </summary>
|
| | | private RowSecondRightTextView inDelayTimeControl = null;
|
| | | private NormalViewControl inDelayTimeControl = null;
|
| | | /// <summary>
|
| | | /// 外出延迟的时间控件
|
| | | /// </summary>
|
| | | private RowSecondRightTextView outDelayTimeControl = null;
|
| | | private NormalViewControl outDelayTimeControl = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | //背景
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Height = Application.GetRealHeight(423);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //该功能只对出入防区有效
|
| | | var btnTitle = new TitleViewControl();
|
| | | btnTitle.TextColor = UserCenterColor.Current.TextGrayColor;
|
| | | btnTitle.Y = Application.GetRealHeight(40);
|
| | | var btnTitle = new NormalViewControl(864, 49, true);
|
| | | btnTitle.X = ControlCommonResourse.XXLeft;
|
| | | btnTitle.Y = Application.GetRealHeight(38);
|
| | | btnTitle.TextSize = 12;
|
| | | btnTitle.TextColor = UserCenterColor.Current.TextGrayColor2;
|
| | | btnTitle.TextID = R.MyInternationalizationString.uThisFunctionOnlyInAndOutSectors;
|
| | | bodyFrameLayout.AddChidren(btnTitle); |
| | | frameBack.AddChidren(btnTitle);
|
| | |
|
| | | var frameTable = new FrameListControl(29);
|
| | | frameTable.Y = btnTitle.Bottom + Application.GetRealHeight(38);
|
| | | frameTable.Height = frameBack.Height - btnTitle.Bottom - Application.GetRealHeight(38);
|
| | | bodyFrameLayout.AddChidren(frameTable);
|
| | | |
| | | //添加所有的菜单 |
| | | this.AddAllMenuRow(btnTitle); |
| | | this.AddAllMenuRow(frameTable);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <summary>
|
| | | /// 添加所有的菜单
|
| | | /// </summary>
|
| | | /// <param name="btnTitle"></param>
|
| | | private async void AddAllMenuRow(TitleViewControl btnTitle)
|
| | | /// <param name="listView"></param>
|
| | | private async void AddAllMenuRow(FrameListControl listView)
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //获取防区的延迟时间(仅限出入防区),出错时返回null
|
| | | this.timeResponseData = await Common.LocalSafeguard.Current.GetGarrisonDelayTime();
|
| | | this.timeResponseData = await HdlSafeguardLogic.Current.GetGarrisonDelayTime();
|
| | | if (timeResponseData == null)
|
| | | {
|
| | | //关闭进度条
|
| | |
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | //初始化【进入延时】行
|
| | | this.InitInDelayedRow(btnTitle);
|
| | | this.InitInDelayedRow(listView);
|
| | |
|
| | | //初始化【外出延时】行
|
| | | this.InitOutDelayedRow(btnTitle);
|
| | | this.InitOutDelayedRow(listView);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | /// <summary>
|
| | | /// 初始化【进入延时】行
|
| | | /// </summary>
|
| | | /// <param name="titleView"></param>
|
| | | private void InitInDelayedRow(TitleViewControl titleView)
|
| | | /// <param name="listView"></param>
|
| | | private void InitInDelayedRow(FrameListControl listView)
|
| | | {
|
| | | var rowLayout = new StatuRowLayout();
|
| | | rowLayout.Y = titleView.Bottom;
|
| | | bodyFrameLayout.AddChidren(rowLayout);
|
| | | var row = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(row);
|
| | | row.Y = 0 - listView.rowSpace;
|
| | |
|
| | | //进入延时
|
| | | var txName = new RowCenterView(false);
|
| | | txName.TextID = R.MyInternationalizationString.uInDelayed;
|
| | | rowLayout.AddChidren(txName);
|
| | |
|
| | | row.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uInDelayed), 500);
|
| | | //添加右箭头
|
| | | row.AddRightArrow();
|
| | | //底线
|
| | | row.AddBottomLine();
|
| | | //时间
|
| | | string second = Language.StringByID(R.MyInternationalizationString.Second);
|
| | | this.inDelayTimeControl = new RowSecondRightTextView();
|
| | | inDelayTimeControl.Text = this.timeResponseData.EntranceDelayTime + " " + second;
|
| | | rowLayout.AddChidren(inDelayTimeControl);
|
| | | this.inDelayTimeControl = row.AddMostRightView(this.timeResponseData.EntranceDelayTime + " " + second, 200);
|
| | | this.inDelayTimeControl.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
|
| | | //添加右箭头
|
| | | rowLayout.AddRightIconControl();
|
| | |
|
| | | rowLayout.MouseUpEvent += (sender, e) =>
|
| | | row.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | List<string> listTime = this.GetTimeList();
|
| | | PickerView.Show(listTime, (value) =>
|
| | | {
|
| | | //保存时间
|
| | | int inTime = Convert.ToInt32(value.Replace(second, string.Empty).Trim());
|
| | | int inTime = Convert.ToInt32(listTime[value].Replace(second, string.Empty).Trim());
|
| | | this.SaveTime(inTime, this.timeResponseData.GoOutDelayTime);
|
| | | });
|
| | | };
|
| | |
| | | /// <summary>
|
| | | /// 初始化【外出延时】行
|
| | | /// </summary>
|
| | | /// <param name="titleView"></param>
|
| | | private void InitOutDelayedRow(TitleViewControl titleView)
|
| | | /// <param name="listView"></param>
|
| | | private void InitOutDelayedRow(FrameListControl listView)
|
| | | {
|
| | | var rowLayout = new StatuRowLayout();
|
| | | rowLayout.Y = titleView.Bottom + ControlCommonResourse.ListViewRowHeight;
|
| | | bodyFrameLayout.AddChidren(rowLayout);
|
| | | var row = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(row);
|
| | |
|
| | | //外出延时
|
| | | var txName = new RowCenterView(false);
|
| | | txName.TextID = R.MyInternationalizationString.uOutDelayed;
|
| | | rowLayout.AddChidren(txName);
|
| | |
|
| | | row.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uOutDelayed), 500);
|
| | | //添加右箭头
|
| | | row.AddRightArrow();
|
| | | //时间
|
| | | string second = Language.StringByID(R.MyInternationalizationString.Second);
|
| | | this.outDelayTimeControl = new RowSecondRightTextView();
|
| | | outDelayTimeControl.Text = this.timeResponseData.GoOutDelayTime + " " + second;
|
| | | rowLayout.AddChidren(outDelayTimeControl);
|
| | | this.outDelayTimeControl = row.AddMostRightView(this.timeResponseData.GoOutDelayTime + " " + second, 200);
|
| | | this.outDelayTimeControl.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
|
| | | //添加右箭头
|
| | | rowLayout.AddRightIconControl();
|
| | |
|
| | | rowLayout.MouseUpEvent += (sender, e) =>
|
| | | row.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | List<string> listTime = this.GetTimeList();
|
| | | PickerView.Show(listTime, (value) =>
|
| | | {
|
| | | //保存时间
|
| | | int outTime = Convert.ToInt32(value.Replace(second, string.Empty).Trim());
|
| | | int outTime = Convert.ToInt32(listTime[value].Replace(second, string.Empty).Trim());
|
| | | this.SaveTime(this.timeResponseData.EntranceDelayTime, outTime);
|
| | | });
|
| | | };
|
| | |
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var result = await Common.LocalSafeguard.Current.SetGarrisonDelayTime(inDelayTime, OutDelayTime);
|
| | | var result = await HdlSafeguardLogic.Current.SetGarrisonDelayTime(inDelayTime, OutDelayTime);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | |
| | | Application.RunOnMainThread(() =>
|
| | | {
|
| | | string second = Language.StringByID(R.MyInternationalizationString.Second);
|
| | | if (this.inDelayTimeControl != null)
|
| | | {
|
| | | this.inDelayTimeControl.Text = inDelayTime + " " + second;
|
| | | }
|
| | | if (this.outDelayTimeControl != null)
|
| | | {
|
| | | this.outDelayTimeControl.Text = OutDelayTime + " " + second;
|
| | | }
|
| | | });
|
| | | }
|
| | | }
|