| | |
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 白色背景框
|
| | | /// 主菜单背景框
|
| | | /// </summary>
|
| | | private FrameLayout frameWhiteBack = null;
|
| | | private FrameLayout frameMainMenuBack = null;
|
| | | /// <summary>
|
| | | /// 其他菜单的容器控件
|
| | | /// </summary>
|
| | | private FrameListControl frameOtherMenuContr = null;
|
| | | /// <summary>
|
| | | /// 用户名字
|
| | | /// </summary>
|
| | |
| | | /// <summary>
|
| | | /// 用户头像
|
| | | /// </summary>
|
| | | private IconViewControl btnUserIcon = null;
|
| | | private ImageView btnUserIcon = null;
|
| | | /// <summary>
|
| | | /// 皇冠
|
| | | /// </summary>
|
| | | private IconViewControl btnImperialCrown = null;
|
| | | /// <summary>
|
| | | /// 信息提示控件
|
| | | /// </summary>
|
| | | private MessageManagementControl msgControl = null;
|
| | |
|
| | | #endregion
|
| | |
|
| | |
| | | btnTitle.Y = Application.GetRealHeight(112);
|
| | | btnTitle.TextColor = UserCenterColor.Current.White;
|
| | | btnTitle.TextSize = 24;
|
| | | btnTitle.IsBold = true;
|
| | | btnTitle.TextID = R.MyInternationalizationString.UserCenter;
|
| | | bodyFrameLayout.AddChidren(btnTitle);
|
| | |
|
| | | var btnBack1 = new PicViewControl(1031, 942);
|
| | | btnBack1.Y = btnTitle.Bottom - Application.GetRealHeight(10);
|
| | | btnBack1.UnSelectedImagePath = "Center/MainBack1.png";
|
| | | bodyFrameLayout.AddChidren(btnBack1);
|
| | | var btnBack2 = new PicViewControl(392, 172);
|
| | | btnBack2.X = Application.GetRealWidth(688);
|
| | | btnBack2.UnSelectedImagePath = "Center/MainBack2.png";
|
| | | bodyFrameLayout.AddChidren(btnBack2);
|
| | |
|
| | | //信息提示控件
|
| | | this.msgControl = new MessageManagementControl();
|
| | | msgControl.Y = Application.GetRealHeight(127);
|
| | | msgControl.X = Application.GetRealWidth(953);
|
| | | bodyFrameLayout.AddChidren(this.msgControl);
|
| | |
|
| | | //白框
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.BodyFrameLayout;
|
| | | frameBack.Y = Application.GetRealHeight(380);
|
| | | frameBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameBack.Radius = (uint)Application.GetMinRealAverage(12);
|
| | | frameBack.Radius = (uint)Application.GetRealHeight(29);
|
| | | frameBack.Width = bodyFrameLayout.Width - Application.GetRealWidth(29 * 2);
|
| | | frameBack.Height = bodyFrameLayout.Height - Application.GetRealHeight(380) + Application.GetRealHeight(100);
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
| | | private void InitUserInfoControl(FrameLayout frameWhite)
|
| | | {
|
| | | //用户头像
|
| | | this.btnUserIcon = new IconViewControl(280);
|
| | | this.btnUserIcon = new ImageView();
|
| | | btnUserIcon.Height = Application.GetMinRealAverage(280);
|
| | | btnUserIcon.Width = Application.GetMinRealAverage(280);
|
| | | btnUserIcon.Radius = (uint)Application.GetMinRealAverage(280) / 2;
|
| | | btnUserIcon.X = Application.GetRealWidth(121);
|
| | | btnUserIcon.UnSelectedImagePath = UserCenterResourse.UserInfo.UserIconFile;
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile);
|
| | | bodyFrameLayout.AddChidren(btnUserIcon);
|
| | | btnUserIcon.Y = frameWhite.Y - Application.GetRealHeight(109);
|
| | | btnUserIcon.MouseUpEventHandler += (sender, e) =>
|
| | |
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1)
|
| | | //皇冠
|
| | | this.btnImperialCrown = new IconViewControl(60);
|
| | | btnImperialCrown.X = Application.GetRealWidth(346);
|
| | | btnImperialCrown.Y = Application.GetRealHeight(475);
|
| | | btnImperialCrown.UnSelectedImagePath = "Center/ImperialCrown.png";
|
| | | bodyFrameLayout.AddChidren(btnImperialCrown);
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1)
|
| | | {
|
| | | //皇冠
|
| | | this.btnImperialCrown = new IconViewControl(60);
|
| | | btnImperialCrown.X = Application.GetRealWidth(346);
|
| | | btnImperialCrown.Y = Application.GetRealHeight(475);
|
| | | btnImperialCrown.UnSelectedImagePath = "Center/ImperialCrown.png";
|
| | | bodyFrameLayout.AddChidren(btnImperialCrown);
|
| | | btnImperialCrown.Visible = false;
|
| | | }
|
| | |
|
| | | //用户昵称
|
| | | this.btnUserName = new NormalViewControl(605, 60, true);
|
| | | btnUserName.IsBold = true;
|
| | | btnUserName.X = btnUserIcon.Right + Application.GetRealWidth(5);
|
| | | btnUserName.Y = Application.GetRealHeight(43);
|
| | | if (UserCenterResourse.UserInfo != null)
|
| | |
| | | /// <param name="frameWhite">背景</param>
|
| | | private void InitMainMenuInfoControl(FrameLayout frameWhite)
|
| | | {
|
| | | if (frameWhiteBack != null)
|
| | | if (frameMainMenuBack != null)
|
| | | {
|
| | | frameWhiteBack.RemoveAll();
|
| | | frameMainMenuBack.RemoveAll();
|
| | | }
|
| | | else
|
| | | {
|
| | | //背景框
|
| | | frameWhiteBack = new FrameLayout();
|
| | | frameWhiteBack.Y = Application.GetRealHeight(288);
|
| | | frameWhiteBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameWhiteBack.Height = Application.GetRealHeight(371);
|
| | | frameWhiteBack.Width = frameWhite.Width - Application.GetRealWidth(29 * 2);
|
| | | frameWhiteBack.Radius = (uint)Application.GetMinRealAverage(10);
|
| | | frameWhiteBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameWhite.AddChidren(frameWhiteBack);
|
| | | frameMainMenuBack = new FrameLayout();
|
| | | frameMainMenuBack.Y = Application.GetRealHeight(288);
|
| | | frameMainMenuBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameMainMenuBack.Height = Application.GetRealHeight(371);
|
| | | frameMainMenuBack.Width = frameWhite.Width - Application.GetRealWidth(29 * 2);
|
| | | frameMainMenuBack.Radius = (uint)Application.GetRealHeight(17);
|
| | | frameMainMenuBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | frameWhite.AddChidren(frameMainMenuBack);
|
| | | }
|
| | |
|
| | | //标题:管理
|
| | |
| | | frameTitle.Width = Application.GetRealWidth(907);
|
| | | frameTitle.Height = Application.GetRealHeight(121);
|
| | | frameTitle.Gravity = Gravity.CenterHorizontal;
|
| | | frameWhiteBack.AddChidren(frameTitle);
|
| | | frameMainMenuBack.AddChidren(frameTitle);
|
| | | var btnTitle = new NormalViewControl(500, 60, true);
|
| | | btnTitle.Gravity = Gravity.CenterVertical;
|
| | | btnTitle.TextID = R.MyInternationalizationString.uManagement;
|
| | |
| | | frameTitle.AddChidren(btnLine);
|
| | |
|
| | | //创建全部的主菜单控件
|
| | | this.CreatAllMainMenuControl(frameWhiteBack);
|
| | | this.CreatAllMainMenuControl(frameMainMenuBack);
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | |
| | | /// <param name="frameWhite">背景</param>
|
| | | private void InitOtherMenuControl(FrameLayout frameWhite)
|
| | | {
|
| | | var frameList = new FrameListControl(26);
|
| | | frameList.Y = Application.GetRealHeight(698);
|
| | | frameList.Height = ControlCommonResourse.ListViewRowHeight * 3 + Application.GetRealHeight(26 * 3);
|
| | | frameWhite.AddChidren(frameList);
|
| | | if (this.frameOtherMenuContr != null)
|
| | | {
|
| | | frameOtherMenuContr.RemoveAll();
|
| | | }
|
| | | else
|
| | | {
|
| | | frameOtherMenuContr = new FrameListControl(26);
|
| | | frameOtherMenuContr.Y = Application.GetRealHeight(698);
|
| | | frameOtherMenuContr.Height = ControlCommonResourse.ListViewRowHeight * 4 + Application.GetRealHeight(26 * 4);
|
| | | frameWhite.AddChidren(frameOtherMenuContr);
|
| | | }
|
| | |
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | {
|
| | | //数据备份
|
| | | var rowback = new FrameRowControl(frameList.rowSpace / 2);
|
| | | frameList.AddChidren(rowback);
|
| | | var rowback = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
|
| | | frameOtherMenuContr.AddChidren(rowback);
|
| | | //向右图标
|
| | | var btnBackRight = rowback.AddRightArrow();
|
| | | btnBackRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | |
| | | btnBackView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | rowback.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new HdlBackup.HdlBackupMenuForm();
|
| | | var form = new HdlBackup.HdlBackupListForm();
|
| | | form.AddForm();
|
| | | };
|
| | | }
|
| | |
|
| | | //意见反馈
|
| | | var rowSuggestion = new FrameRowControl(frameList.rowSpace / 2);
|
| | | frameList.AddChidren(rowSuggestion);
|
| | | var rowSuggestion = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
|
| | | frameOtherMenuContr.AddChidren(rowSuggestion);
|
| | | //向右图标
|
| | | var btnSuRight = rowSuggestion.AddRightArrow();
|
| | | btnSuRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | |
| | | btnSuView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | rowSuggestion.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new DeviceDoorLock.DoorLockHistoryLogForm();
|
| | | form.AddForm("天下第一");
|
| | | var form = new Suggestion.FeedbackForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | //关于我们
|
| | | var rowAbount = new FrameRowControl(frameList.rowSpace / 2);
|
| | | frameList.AddChidren(rowAbount);
|
| | | var rowAbount = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
|
| | | frameOtherMenuContr.AddChidren(rowAbount);
|
| | | //向右图标
|
| | | var btnAbountRight = rowAbount.AddRightArrow();
|
| | | btnAbountRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | |
| | | var form = new Abount.AbountForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | if (UserCenterResourse.HideOption.CenterHideMenu == 1)
|
| | | {
|
| | | //隐匿菜单
|
| | | var rowHide = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
|
| | | frameOtherMenuContr.AddChidren(rowHide);
|
| | | //向右图标
|
| | | var btnHideRight = rowHide.AddRightArrow();
|
| | | btnHideRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | | //图标
|
| | | var btnHideIcon = rowHide.AddLeftIcon();
|
| | | btnHideIcon.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnHideIcon.UnSelectedImagePath = "Center/Abount.png";
|
| | | //底线
|
| | | var btnHideLine = rowHide.AddBottomLine();
|
| | | btnHideLine.X -= ControlCommonResourse.XXLeft / 2;
|
| | | //隐匿菜单View
|
| | | var btnHideView = rowHide.AddLeftCaption("隐匿菜单", 300);
|
| | | btnHideView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | rowHide.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var from = new HideOption.HideOptionMainForm();
|
| | | from.AddForm();
|
| | | };
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //用户头像
|
| | | btnUserIcon.UnSelectedImagePath = UserCenterResourse.UserInfo.UserIconFile;
|
| | | if (UserCenterResourse.UserInfo.UserIconFileChanged == true)
|
| | | {
|
| | | UserCenterResourse.UserInfo.UserIconFileChanged = false;
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile);
|
| | | }
|
| | | //用户名字
|
| | | btnUserName.Text = UserCenterResourse.UserInfo.UserName;
|
| | | if (UserCenterResourse.UserInfo != null)
|
| | |
| | | //用户身份
|
| | | btnAuthority.Text = UserCenterResourse.UserInfo.AuthorityText;
|
| | | }
|
| | | if (this.btnImperialCrown != null)
|
| | | //皇冠
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1)
|
| | | {
|
| | | //皇冠
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1)
|
| | | {
|
| | | this.btnImperialCrown.Visible = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.btnImperialCrown.Visible = true;
|
| | | }
|
| | | this.btnImperialCrown.Visible = false;
|
| | | }
|
| | | else
|
| | | {
|
| | | this.btnImperialCrown.Visible = true;
|
| | | }
|
| | |
|
| | | //刷新信息提示控件
|
| | | this.msgControl?.RefreshStatu();
|
| | |
|
| | | //初始化主菜单的控件
|
| | | this.InitMainMenuInfoControl(frameWhiteBack);
|
| | | this.InitMainMenuInfoControl(null);
|
| | | //初始化其他菜单的控件
|
| | | this.InitOtherMenuControl(null);
|
| | |
|
| | | return 1;
|
| | | }
|