| | |
| | |
|
| | | //个人中心
|
| | | var btnTitle = new NormalViewControl(450, 100, true);
|
| | | btnTitle.X = ControlCommonResourse.XXLeft;
|
| | | btnTitle.X = HdlControlResourse.XXLeft;
|
| | | btnTitle.Y = Application.GetRealHeight(112);
|
| | | btnTitle.TextColor = UserCenterColor.Current.White;
|
| | | btnTitle.TextSize = 24;
|
| | |
| | | btnUserIcon.X = Application.GetRealWidth(121);
|
| | | if (Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile);
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(HdlFileNameResourse.UserHeadIconFile);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | //退出账号
|
| | | UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account);
|
| | | HdlAccountLogic.Current.ReLoginAgain(Common.Config.Instance.Account);
|
| | | });
|
| | | return;
|
| | | }
|
| | |
| | | btnImperialCrown.Y = Application.GetRealHeight(475);
|
| | | btnImperialCrown.UnSelectedImagePath = "Center/ImperialCrown.png";
|
| | | bodyFrameLayout.AddChidren(btnImperialCrown);
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1)
|
| | | {
|
| | | btnImperialCrown.Visible = false;
|
| | | }
|
| | |
| | | btnUserName.IsBold = true;
|
| | | btnUserName.X = btnUserIcon.Right + Application.GetRealWidth(5);
|
| | | btnUserName.Y = Application.GetRealHeight(43);
|
| | | if (UserCenterResourse.UserInfo != null)
|
| | | if (HdlUserCenterResourse.UserInfo != null)
|
| | | {
|
| | | btnUserName.Text = UserCenterResourse.UserInfo.UserName;
|
| | | btnUserName.Text = HdlUserCenterResourse.UserInfo.NickName;
|
| | | }
|
| | | frameWhite.AddChidren(btnUserName);
|
| | |
|
| | |
| | | btnAuthority.Y = btnUserName.Bottom;
|
| | | btnAuthority.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnAuthority.TextSize = 12;
|
| | | if (UserCenterResourse.UserInfo != null)
|
| | | {
|
| | | btnAuthority.Text = UserCenterResourse.UserInfo.AuthorityText;
|
| | | }
|
| | | btnAuthority.Text = HdlUserCenterResourse.ResidenceOption.AuthorityText;
|
| | | frameWhite.AddChidren(btnAuthority);
|
| | | }
|
| | |
|
| | |
| | | //成员管理
|
| | | string unSelectPic = "Center/MenberManagement.png";
|
| | | int TextID = R.MyInternationalizationString.uMember;
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2)
|
| | | {
|
| | | //生成控件
|
| | | var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic);
|
| | |
| | | //设备管理
|
| | | unSelectPic = "Center/DeviceManagement.png";
|
| | | TextID = R.MyInternationalizationString.uDevice;
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2)
|
| | | {
|
| | | //生成控件
|
| | | var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic);
|
| | |
| | | {
|
| | | HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
|
| | | //拥有网关,或者是虚拟住宅,则进入设备列表界面
|
| | | if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false
|
| | | if (string.IsNullOrEmpty(HdlGatewayResourse.AppOldSelectGatewayId) == false
|
| | | || Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | var form = new Device.DeviceListMainForm();
|
| | |
| | | {
|
| | | frameOtherMenuContr = new FrameListControl(26);
|
| | | frameOtherMenuContr.Y = Application.GetRealHeight(698);
|
| | | frameOtherMenuContr.Height = ControlCommonResourse.ListViewRowHeight * 4 + Application.GetRealHeight(26 * 4);
|
| | | frameOtherMenuContr.Height = HdlControlResourse.ListViewRowHeight * 4 + Application.GetRealHeight(26 * 4);
|
| | | frameWhite.AddChidren(frameOtherMenuContr);
|
| | | }
|
| | |
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo == 1 || UserCenterResourse.UserInfo.AuthorityNo == 2)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo == 1 || HdlUserCenterResourse.ResidenceOption.AuthorityNo == 2)
|
| | | {
|
| | | //数据备份
|
| | | var rowback = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
|
| | | frameOtherMenuContr.AddChidren(rowback);
|
| | | //向右图标
|
| | | var btnBackRight = rowback.AddRightArrow();
|
| | | btnBackRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnBackRight.X -= HdlControlResourse.XXLeft / 2;
|
| | | //图标
|
| | | var btnBackIcon = rowback.AddLeftIcon();
|
| | | btnBackIcon.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnBackIcon.X -= HdlControlResourse.XXLeft / 2;
|
| | | btnBackIcon.UnSelectedImagePath = "Center/Backup.png";
|
| | | //底线
|
| | | var btnBackLine = rowback.AddBottomLine();
|
| | | btnBackLine.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnBackLine.X -= HdlControlResourse.XXLeft / 2;
|
| | | //数据备份View
|
| | | var btnBackView = rowback.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uDataBackup), 300);
|
| | | btnBackView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnBackView.X -= HdlControlResourse.XXLeft / 2;
|
| | | rowback.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | |
| | | frameOtherMenuContr.AddChidren(rowSuggestion);
|
| | | //向右图标
|
| | | var btnSuRight = rowSuggestion.AddRightArrow();
|
| | | btnSuRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnSuRight.X -= HdlControlResourse.XXLeft / 2;
|
| | | //图标
|
| | | var btnSuggestionIcon = rowSuggestion.AddLeftIcon();
|
| | | btnSuggestionIcon.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnSuggestionIcon.X -= HdlControlResourse.XXLeft / 2;
|
| | | btnSuggestionIcon.UnSelectedImagePath = "Center/Opinion.png";
|
| | | //底线
|
| | | var btnSuLine = rowSuggestion.AddBottomLine();
|
| | | btnSuLine.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnSuLine.X -= HdlControlResourse.XXLeft / 2;
|
| | | //意见反馈View
|
| | | var btnSuView = rowSuggestion.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.Suggestions), 300);
|
| | | btnSuView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnSuView.X -= HdlControlResourse.XXLeft / 2;
|
| | | rowSuggestion.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new Suggestion.FeedbackForm();
|
| | |
| | | frameOtherMenuContr.AddChidren(rowAbount);
|
| | | //向右图标
|
| | | var btnAbountRight = rowAbount.AddRightArrow();
|
| | | btnAbountRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnAbountRight.X -= HdlControlResourse.XXLeft / 2;
|
| | | //图标
|
| | | var btnAbountIcon = rowAbount.AddLeftIcon();
|
| | | btnAbountIcon.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnAbountIcon.X -= HdlControlResourse.XXLeft / 2;
|
| | | btnAbountIcon.UnSelectedImagePath = "Center/Abount.png";
|
| | | //底线
|
| | | var btnAbountLine = rowAbount.AddBottomLine();
|
| | | btnAbountLine.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnAbountLine.X -= HdlControlResourse.XXLeft / 2;
|
| | | //关于我们View
|
| | | var btnAbountView = rowAbount.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uAboutMe), 300);
|
| | | btnAbountView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnAbountView.X -= HdlControlResourse.XXLeft / 2;
|
| | | rowAbount.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | return;
|
| | | }
|
| | | var form = new Abount.AbountForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
|
| | | if (UserCenterResourse.HideOption.CenterHideMenu == 1)
|
| | | if (HdlUserCenterResourse.HideOption.CenterHideMenu == 1)
|
| | | {
|
| | | //隐匿菜单
|
| | | var rowHide = new FrameRowControl(frameOtherMenuContr.rowSpace / 2);
|
| | | frameOtherMenuContr.AddChidren(rowHide);
|
| | | //向右图标
|
| | | var btnHideRight = rowHide.AddRightArrow();
|
| | | btnHideRight.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnHideRight.X -= HdlControlResourse.XXLeft / 2;
|
| | | //图标
|
| | | var btnHideIcon = rowHide.AddLeftIcon();
|
| | | btnHideIcon.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnHideIcon.X -= HdlControlResourse.XXLeft / 2;
|
| | | btnHideIcon.UnSelectedImagePath = "Center/Abount.png";
|
| | | //底线
|
| | | var btnHideLine = rowHide.AddBottomLine();
|
| | | btnHideLine.X -= ControlCommonResourse.XXLeft / 2;
|
| | | btnHideLine.X -= HdlControlResourse.XXLeft / 2;
|
| | | //隐匿菜单View
|
| | | var btnHideView = rowHide.AddLeftCaption("隐匿菜单", 300);
|
| | | btnHideView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | var btnHideView = rowHide.AddLeftCaption("调试菜单", 300);
|
| | | btnHideView.X -= HdlControlResourse.XXLeft / 2;
|
| | | rowHide.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var from = new HideOption.HideOptionMainForm();
|
| | |
| | | return -1;
|
| | | }
|
| | | //用户头像
|
| | | if (UserCenterResourse.UserInfo.UserIconFileChanged == true)
|
| | | if (HdlUserCenterResourse.UserInfo.UserIconFileChanged == true)
|
| | | {
|
| | | UserCenterResourse.UserInfo.UserIconFileChanged = false;
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile);
|
| | | HdlUserCenterResourse.UserInfo.UserIconFileChanged = false;
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(HdlFileNameResourse.UserHeadIconFile);
|
| | | }
|
| | | //用户名字
|
| | | btnUserName.Text = UserCenterResourse.UserInfo.UserName;
|
| | | if (UserCenterResourse.UserInfo != null)
|
| | | {
|
| | | //用户身份
|
| | | btnAuthority.Text = UserCenterResourse.UserInfo.AuthorityText;
|
| | | }
|
| | | btnUserName.Text = HdlUserCenterResourse.UserInfo.NickName;
|
| | | //用户身份
|
| | | btnAuthority.Text = HdlUserCenterResourse.ResidenceOption.AuthorityText;
|
| | | //皇冠
|
| | | if (UserCenterResourse.UserInfo.AuthorityNo != 1)
|
| | | if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1)
|
| | | {
|
| | | this.btnImperialCrown.Visible = false;
|
| | | }
|