New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.Safety
|
| | | {
|
| | | /// <summary>
|
| | | /// 用户密码的列表界面
|
| | | /// </summary>
|
| | | public class PasswordListUserForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | public void ShowForm()
|
| | | {
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uSafetyPassword));
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | public void InitMiddleFrame()
|
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var listData = await HdlSafeguardLogic.Current.GetAllUserPassword();
|
| | | if (listData == null)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return;
|
| | | }
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | var dicEsixt = new Dictionary<int, ZigBee.Device.Safeguard.UserPasswordListObj>();
|
| | | foreach (var data in listData)
|
| | | {
|
| | | dicEsixt[data.UserId] = data;
|
| | | }
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | var listView = new VerticalListControl(29);
|
| | | listView.Y = Application.GetRealHeight(-6);
|
| | | listView.Height = bodyFrameLayout.Height;
|
| | | listView.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(listView);
|
| | |
|
| | | //4个用户密码
|
| | | for (int i = 1; i <= 4; i++)
|
| | | {
|
| | | //添加行
|
| | | this.AddPassworRow(listView, dicEsixt, i);
|
| | | }
|
| | | listView.AdjustRealHeight(Application.GetRealHeight(23));
|
| | | });
|
| | | }); |
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 添加行_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 添加行
|
| | | /// </summary>
|
| | | /// <param name="listView"></param>
|
| | | /// <param name="dicEsixt"></param>
|
| | | /// <param name="pswNo"></param>
|
| | | private void AddPassworRow(VerticalListControl listView, Dictionary<int, ZigBee.Device.Safeguard.UserPasswordListObj> dicEsixt, int pswNo)
|
| | | {
|
| | | string text = Language.StringByID(R.MyInternationalizationString.uUserPassword) + pswNo;
|
| | | if (dicEsixt.ContainsKey(pswNo) == true && string.IsNullOrEmpty(dicEsixt[pswNo].PassWordTips) == false)
|
| | | {
|
| | | text = dicEsixt[pswNo].PassWordTips;
|
| | | }
|
| | |
|
| | | //添加【用户密码】行
|
| | | var rowUserPsw = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(rowUserPsw);
|
| | | //图标
|
| | | var btnUserPswIcon = rowUserPsw.AddLeftIcon(81);
|
| | | btnUserPswIcon.UnSelectedImagePath = "Item/Point.png";
|
| | | //用户密码
|
| | | var btnUserPswText = rowUserPsw.AddLeftCaption(text, 700);
|
| | | btnUserPswText.TextSize = 15;
|
| | | //向右的图标
|
| | | rowUserPsw.AddRightArrow();
|
| | | if (dicEsixt.ContainsKey(pswNo) == false)
|
| | | {
|
| | | //未设置
|
| | | rowUserPsw.AddMostRightView(Language.StringByID(R.MyInternationalizationString.uNotHadSettion), 300);
|
| | | }
|
| | | if (pswNo != 4)
|
| | | {
|
| | | //底线
|
| | | rowUserPsw.AddBottomLine();
|
| | | }
|
| | | rowUserPsw.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //新建
|
| | | if (dicEsixt.ContainsKey(pswNo) == false)
|
| | | {
|
| | | var form = new PasswordAddNewForm();
|
| | | form.AddForm(pswNo, text);
|
| | | }
|
| | | //编辑
|
| | | else
|
| | | {
|
| | | var form = new PasswordUserEditorForm();
|
| | | form.AddForm(pswNo, dicEsixt[pswNo].Password, text);
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 界面重新激活事件___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 自身的上层界面关闭后,它自身处于最上层时,触发的事件
|
| | | /// </summary>
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //重新初始化
|
| | | this.InitMiddleFrame();
|
| | | return 1;
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|