| | |
| | | /// </summary>
|
| | | private string passwordTip = string.Empty;
|
| | | /// <summary>
|
| | | /// 列表的桌布控件
|
| | | /// 联系人的列表控件
|
| | | /// </summary>
|
| | | private FrameLayout frameTable = null;
|
| | | private FrameListControl listPhoneView = null;
|
| | | /// <summary>
|
| | | /// 信息控件
|
| | | /// </summary>
|
| | | private InformationEditorControl tableContr = null;
|
| | | /// <summary>
|
| | | /// 密码控件
|
| | | /// </summary>
|
| | | private NormalViewControl btnPassword = null;
|
| | | /// <summary>
|
| | | /// 当前的联系人列表
|
| | | /// </summary>
|
| | |
| | | {
|
| | | this.password = i_password;
|
| | | this.passwordTip = i_passwordTip;
|
| | | this.ScrollEnabled = false;
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uCoercePassword));
|
| | |
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | this.frameTable = new FrameLayout();
|
| | | frameTable.Height = bodyFrameLayout.Height;
|
| | | bodyFrameLayout.AddChidren(frameTable);
|
| | | var listBackControl = new VerticalFrameControl();
|
| | | listBackControl.Height = bodyFrameLayout.Height;
|
| | | bodyFrameLayout.AddChidren(listBackControl);
|
| | |
|
| | | var frameback = new FrameLayout();
|
| | | frameback.Y = Application.GetRealHeight(179);
|
| | |
| | | frameback.Width = Application.GetRealWidth(717);
|
| | | frameback.Gravity = Gravity.CenterHorizontal;
|
| | | frameback.BackgroundImagePath = "Safeguard/SafeguardPasswordGround.png";
|
| | | bodyFrameLayout.AddChidren(frameback);
|
| | | listBackControl.frameTable.AddChidren(frameback);
|
| | | //当前使用密码
|
| | | var btnNowTip = new NormalViewControl(frameback.Width, Application.GetRealHeight(50), false);
|
| | | btnNowTip.Y = Application.GetRealHeight(81);
|
| | |
| | | btnNowTip.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnNowTip.TextID = R.MyInternationalizationString.uNowUsePassword;
|
| | | frameback.AddChidren(btnNowTip);
|
| | | var btnPassword = new NormalViewControl(frameback.Width, Application.GetRealHeight(90), false);
|
| | | this.btnPassword = new NormalViewControl(frameback.Width, Application.GetRealHeight(90), false);
|
| | | btnPassword.TextAlignment = TextAlignment.Center;
|
| | | btnPassword.Y = Application.GetRealHeight(150);
|
| | | btnPassword.TextSize = 24;
|
| | |
| | | frameback.AddChidren(btnPassword);
|
| | |
|
| | | //初始化列表控件
|
| | | this.InitListViewControl();
|
| | | this.InitListViewControl(listBackControl);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化列表控件
|
| | | /// </summary>
|
| | | private void InitListViewControl()
|
| | | private void InitListViewControl(VerticalFrameControl listBackControl)
|
| | | {
|
| | | this.frameTable.RemoveAll();
|
| | |
|
| | | //初始化桌布
|
| | | var tableContr = new InformationEditorControl();
|
| | | var listview = tableContr.InitControl(this.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 711, 1025);
|
| | | this.tableContr = new InformationEditorControl();
|
| | | var listView = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1025);
|
| | |
|
| | | //备注信息
|
| | | string caption = Language.StringByID(R.MyInternationalizationString.uNoteInformation);
|
| | | var rowNote = new FrameCaptionInputControl(caption, passwordTip, listview.rowSpace / 2);
|
| | | var rowNote = new FrameCaptionInputControl(caption, passwordTip, listView.rowSpace / 2);
|
| | | rowNote.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPlesaeInputNoteInformation);
|
| | | rowNote.txtInput.MaxByte = 90;
|
| | | listview.AddChidren(rowNote);
|
| | | listView.AddChidren(rowNote);
|
| | | rowNote.InitControl();
|
| | | rowNote.AddBottomLine();
|
| | | rowNote.txtInput.FinishInputEvent += () =>
|
| | | rowNote.txtInput.FinishInputEvent += async () =>
|
| | | {
|
| | | if (rowNote.Text == string.Empty)
|
| | | {
|
| | |
| | | if (passwordTip != rowNote.Text)
|
| | | {
|
| | | //修改密码备注
|
| | | this.EditorPassworTip(password, rowNote.Text);
|
| | | await this.EditorPassworTip(password, rowNote.Text, true);
|
| | | }
|
| | | };
|
| | |
|
| | | //修改密码
|
| | | var rowPsw = new FrameRowControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(rowPsw);
|
| | | var rowPsw = new FrameRowControl(listView.rowSpace / 2);
|
| | | listView.AddChidren(rowPsw);
|
| | | rowPsw.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uChangedPassword), 300);
|
| | | rowPsw.AddRightArrow();
|
| | | rowPsw.AddBottomLine();
|
| | |
| | | {
|
| | | var form = new CoercePswAddNewForm();
|
| | | form.AddForm(rowNote.Text);
|
| | | form.PasswordChangedEvent += (newPassword) =>
|
| | | {
|
| | | this.btnPassword.Text = newPassword;
|
| | | this.password = newPassword;
|
| | | };
|
| | | };
|
| | |
|
| | | //初始化联系人控件
|
| | | this.InitPhoneControl(listView);
|
| | |
|
| | | //重写底层的返回按键事件
|
| | | this.BackButtonClickEvent += async (sender) =>
|
| | | {
|
| | | sender.CanClick = false;
|
| | | if (rowNote.Text == string.Empty || passwordTip == rowNote.Text)
|
| | | {
|
| | | this.CloseForm();
|
| | | }
|
| | | else
|
| | | {
|
| | | //修改密码备注
|
| | | var result = await this.EditorPassworTip(password, rowNote.Text, false);
|
| | | sender.CanClick = true;
|
| | | if (result == true)
|
| | | {
|
| | | this.CloseForm();
|
| | | }
|
| | | }
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化联系人控件___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化联系人控件
|
| | | /// </summary>
|
| | | private void InitPhoneControl(FrameListControl listTableView)
|
| | | {
|
| | | //联系人的列表控件
|
| | | if (listPhoneView == null)
|
| | | {
|
| | | this.listPhoneView = new FrameListControl();
|
| | | listPhoneView.rowSpace = listTableView.rowSpace;
|
| | | listPhoneView.Height = Application.GetRealHeight(200);
|
| | | listTableView.AddChidren(listPhoneView);
|
| | | listPhoneView.Y -= listTableView.rowSpace;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.listPhoneView.RemoveAll();
|
| | | }
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | |
| | | {
|
| | | this.listPhoneData = new List<ZigBee.Device.Safeguard.PushTargetInfo>();
|
| | | //联系人
|
| | | var rowContact = new FrameRowControl(listview.rowSpace / 2);
|
| | | var rowContact = new FrameRowControl(this.listPhoneView.rowSpace / 2);
|
| | | rowContact.UseClickStatu = false;
|
| | | listview.AddChidren(rowContact);
|
| | | listPhoneView.AddChidren(rowContact);
|
| | | rowContact.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uContactPersion), 300);
|
| | | var btnAdd = rowContact.AddMostRightEmptyIcon(81, 81);
|
| | | btnAdd.UnSelectedImagePath = "Item/Add.png";
|
| | |
| | | {
|
| | | var form = new CoercePswAddContactForm();
|
| | | form.AddForm(listPhoneData);
|
| | | form.AddPhoneEvent += () =>
|
| | | {
|
| | | //重新刷新
|
| | | this.InitPhoneControl(listTableView);
|
| | | };
|
| | | };
|
| | |
|
| | | if (result.Actions.Count > 0)
|
| | |
| | | foreach (var data in listPhoneData)
|
| | | {
|
| | | //添加联系人行
|
| | | this.AddPhoneNumRowLayout(listview, data);
|
| | | this.AddPhoneNumRowLayout(data);
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | //没有联系人的话,添加个底线
|
| | | rowContact.AddBottomLine();
|
| | | }
|
| | | //调整桌布大小
|
| | | this.AdjustPhoneContrlTable();
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 调整桌布大小
|
| | | /// </summary>
|
| | | private void AdjustPhoneContrlTable()
|
| | | {
|
| | | //调整桌布
|
| | | listPhoneView.AdjustRealHeight();
|
| | | tableContr.FinishInitControl(false, true);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | /// <summary>
|
| | | /// 添加联系人行
|
| | | /// </summary>
|
| | | /// <param name="listview"></param>
|
| | | /// <param name="data"></param>
|
| | | private void AddPhoneNumRowLayout(VerticalListControl listview, ZigBee.Device.Safeguard.PushTargetInfo data)
|
| | | private void AddPhoneNumRowLayout(ZigBee.Device.Safeguard.PushTargetInfo data)
|
| | | {
|
| | | var strArry = data.PushNumber.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);
|
| | | if (strArry.Length != 2)
|
| | |
| | | }
|
| | |
|
| | | var rowContact = new RowLayoutControl();
|
| | | listview.AddChidren(rowContact);
|
| | | rowContact.MainKeys = strPhone;
|
| | | this.listPhoneView.AddChidren(rowContact);
|
| | | rowContact.frameTable.UseClickStatu = false;
|
| | | //联系方式
|
| | | rowContact.frameTable.AddLeftCaption(strPhone + " (" + data.PushNumberNote + ")", 800);
|
| | |
| | | bool result = await HdlSafeguardLogic.Current.DeleteCoercePhoneNumber(areaCode, phone);
|
| | | if (result == true)
|
| | | {
|
| | | bool canMove = false;
|
| | | for (int i = 0; i < this.listPhoneView.ChildrenCount; i++)
|
| | | {
|
| | | var myRow = this.listPhoneView.GetChildren(i) as RowLayoutControl;
|
| | | if (myRow != null && myRow.MainKeys == rowContact.MainKeys)
|
| | | {
|
| | | //循环到了当前控件
|
| | | canMove = true;
|
| | | continue;
|
| | | }
|
| | | if (canMove == true)
|
| | | {
|
| | | //它之后的控件全部往上移动
|
| | | myRow.Y -= rowContact.Height;
|
| | | }
|
| | | }
|
| | | rowContact.RemoveFromParent();
|
| | |
|
| | | //移除缓存
|
| | |
| | | listPhoneData.RemoveAt(i);
|
| | | }
|
| | | }
|
| | | //调整桌布大小
|
| | | this.AdjustPhoneContrlTable();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | /// </summary>
|
| | | /// <param name="i_password">用户密码</param>
|
| | | /// <param name="i_passwordTip">用户密码提示</param>
|
| | | private async void EditorPassworTip(string i_password, string i_passwordTip)
|
| | | private async System.Threading.Tasks.Task<bool> EditorPassworTip(string i_password, string i_passwordTip, bool ShowMsg)
|
| | | {
|
| | | var result = await HdlSafeguardLogic.Current.AddPassWordTips(this.pswNo, i_password, i_passwordTip);
|
| | | if (result == true)
|
| | | {
|
| | | //修改备注信息成功!
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uEditorNoteInformationSuccess);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | if (ShowMsg == true)
|
| | | {
|
| | | //修改备注信息成功!
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uEditorNoteInformationSuccess);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | }
|
| | |
|
| | | this.passwordTip = i_passwordTip;
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 界面重新激活事件___________________
|
| | |
|
| | | /// <summary>
|
| | | /// 自身的上层界面关闭后,它自身处于最上层时,触发的事件
|
| | | /// </summary>
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //初始化列表控件
|
| | | this.InitListViewControl();
|
| | | return 1;
|
| | | return result;
|
| | | }
|
| | |
|
| | | #endregion
|