| | |
| | | /// <summary>
|
| | | /// 主菜单背景框
|
| | | /// </summary>
|
| | | private FrameLayout frameMainMenuBack = null;
|
| | | private NormalFrameLayout frameMainMenuBack = null;
|
| | | /// <summary>
|
| | | /// 其他菜单的容器控件
|
| | | /// </summary>
|
| | |
| | | /// </summary>
|
| | | public void ShowForm()
|
| | | {
|
| | | this.FormID = "UserMainForm";
|
| | |
|
| | | //特殊处理:恢复可关闭进度条,别问为什么,我也不知道为什么,以防万一而已
|
| | | ProgressBar.SetCloseBarFlag(false);
|
| | | //初始化框架
|
| | | this.InitForm();
|
| | | //初始化头部控件
|
| | | this.InitTopFrameLayout();
|
| | | //初始化中部控件
|
| | | this.InitBodyFrameLayout();
|
| | | //移除返回键
|
| | | base.RemoveBackButton();
|
| | |
|
| | | //body占完整个屏幕,除了底部菜单
|
| | | bodyFrameLayout.Y = 0;
|
| | | bodyFrameLayout.Height = ControlCommonResourse.TopMenuFrameHeight + ControlCommonResourse.TopFrameHeight
|
| | | + ControlCommonResourse.BodyFrameHeight - ControlCommonResourse.BottomFrameHeight;
|
| | | bodyFrameLayout.Height = this.Height;
|
| | | bodyFrameLayout.BackgroundColor = UserCenterColor.Current.BlackBackGround;
|
| | |
|
| | | //初始化中部控件
|
| | |
| | | this.ClearBodyFrame();
|
| | |
|
| | | //个人中心
|
| | | var btnTitle = new NormalViewControl(350, 100, true);
|
| | | var btnTitle = new NormalViewControl(450, 100, true);
|
| | | btnTitle.X = ControlCommonResourse.XXLeft;
|
| | | btnTitle.Y = Application.GetRealHeight(112);
|
| | | btnTitle.TextColor = UserCenterColor.Current.White;
|
| | |
| | | {
|
| | | //用户头像
|
| | | this.btnUserIcon = new ImageView();
|
| | | btnUserIcon.Height = Application.GetMinRealAverage(280);
|
| | | btnUserIcon.Width = Application.GetMinRealAverage(280);
|
| | | btnUserIcon.Radius = (uint)Application.GetMinRealAverage(280) / 2;
|
| | | btnUserIcon.Height = this.GetPictrueRealSize(280);
|
| | | btnUserIcon.Width = this.GetPictrueRealSize(280);
|
| | | btnUserIcon.Radius = (uint)this.GetPictrueRealSize(280) / 2;
|
| | | btnUserIcon.X = Application.GetRealWidth(121);
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile);
|
| | | if (Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | btnUserIcon.ImageBytes = Shared.IO.FileUtils.ReadFile(UserCenterResourse.UserInfo.UserIconFile);
|
| | | }
|
| | | else
|
| | | {
|
| | | btnUserIcon.ImagePath = "Account/Cat.png";
|
| | | }
|
| | | bodyFrameLayout.AddChidren(btnUserIcon);
|
| | | btnUserIcon.Y = frameWhite.Y - Application.GetRealHeight(109);
|
| | | btnUserIcon.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则直接提示:确定退出当前账号?
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uLogoutAccountMsg);
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | //退出账号
|
| | | UserCenterLogic.ReLoginAgain(Common.Config.Instance.Account);
|
| | | });
|
| | | return;
|
| | | }
|
| | | var form = new UserInformationForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
| | | else
|
| | | {
|
| | | //背景框
|
| | | frameMainMenuBack = new FrameLayout();
|
| | | frameMainMenuBack = new NormalFrameLayout();
|
| | | frameMainMenuBack.Y = Application.GetRealHeight(288);
|
| | | frameMainMenuBack.Gravity = Gravity.CenterHorizontal;
|
| | | frameMainMenuBack.Height = Application.GetRealHeight(371);
|
| | |
| | | var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic);
|
| | | frame.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | return;
|
| | | }
|
| | | var form = new Member.MemberListForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
| | | frame.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
|
| | | if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false)
|
| | | //拥有网关,或者是虚拟住宅,则进入设备列表界面
|
| | | if (string.IsNullOrEmpty(GatewayResourse.AppOldSelectGatewayId) == false
|
| | | || Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | var form = new Device.DeviceListMainForm();
|
| | | form.AddForm();
|
| | | }
|
| | | else
|
| | | {
|
| | | //没有网关,则进入网关列表界面
|
| | | var form = new GatewayManage.GatewayListForm();
|
| | | form.AddForm();
|
| | | }
|
| | |
| | | frame.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //住宅接口不需要特殊的登陆Token
|
| | | var form = new Residence.ResidenceListForm();
|
| | | var form = new Residence.ResidenceListMainForm();
|
| | | form.AddForm();
|
| | | };
|
| | | }
|
| | |
| | | var frame = this.CreatMainMenuControl(frameMenu, TextID, unSelectPic);
|
| | | frame.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | return;
|
| | | }
|
| | | var form = new Safety.SafetyManagementMainForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
| | | btnBackView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | rowback.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | return;
|
| | | }
|
| | | var form = new HdlBackup.HdlBackupListForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
| | | btnAbountView.X -= ControlCommonResourse.XXLeft / 2;
|
| | | rowAbount.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | //如果住宅为虚拟住宅,则此功能无效
|
| | | return;
|
| | | }
|
| | | var form = new Abount.AbountForm();
|
| | | form.AddForm();
|
| | | };
|
| | |
| | | /// </summary>
|
| | | public override int FormActionAgainEvent()
|
| | | {
|
| | | //虚拟住宅不需要刷新
|
| | | if (Common.Config.Instance.Home.IsVirtually == true)
|
| | | {
|
| | | return -1;
|
| | | }
|
| | | //用户头像
|
| | | if (UserCenterResourse.UserInfo.UserIconFileChanged == true)
|
| | | {
|