| | |
| | | /// <summary>
|
| | | /// 列表控件
|
| | | /// </summary>
|
| | | private VerticalListControl listview = null;
|
| | | private FrameListControl listview = null;
|
| | | /// <summary>
|
| | | /// 当前选择的网关
|
| | | /// </summary>
|
| | |
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | var listBackControl = new VerticalFrameControl();
|
| | | listBackControl.Height = bodyFrameLayout.Height;
|
| | | bodyFrameLayout.AddChidren(listBackControl);
|
| | |
|
| | | //初始化桌布
|
| | | var tableContr = new InformationEditorControl();
|
| | | this.listview = tableContr.InitControl(bodyFrameLayout, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 369, 1368);
|
| | | this.listview = tableContr.InitControl(listBackControl.frameTable, Language.StringByID(R.MyInternationalizationString.uInfoEditor), 1368);
|
| | |
|
| | | //图片
|
| | | var btnPic = new DeviceInfoIconControl();
|
| | | btnPic.Y = Application.GetRealHeight(92);
|
| | | btnPic.Gravity = Gravity.CenterHorizontal;
|
| | | bodyFrameLayout.AddChidren(btnPic);
|
| | | listBackControl.frameTable.AddChidren(btnPic);
|
| | | btnPic.InitControl(this.zbGateway);
|
| | |
|
| | | //设备备注
|
| | |
| | | }
|
| | | };
|
| | |
|
| | | //设备类型
|
| | | //设备类型 (固定智能网关)
|
| | | caption = Language.StringByID(R.MyInternationalizationString.uDeviceType);
|
| | | var btnType = new FrameCaptionViewControl(caption, nameValue, listview.rowSpace / 2);
|
| | | var btnType = new FrameCaptionViewControl(caption, Language.StringByID(60004), listview.rowSpace / 2);
|
| | | btnType.UseClickStatu = false;
|
| | | listview.AddChidren(btnType);
|
| | | btnType.InitControl();
|
| | | HdlGatewayLogic.Current.SetGatewayImageText(btnType.txtView, this.zbGateway);
|
| | | //划线
|
| | | btnType.AddBottomLine();
|
| | |
|
| | | //安装位置
|
| | | var rowBeloneArea = new BelongAreaControl(listview.rowSpace / 2);
|
| | | listview.AddChidren(rowBeloneArea);
|
| | | rowBeloneArea.InitControl(Language.StringByID(R.MyInternationalizationString.uInstallationLocation), this.zbGateway);
|
| | | //底线
|
| | | rowBeloneArea.AddBottomLine();
|
| | | rowBeloneArea.SelectRoomEvent += (roomKeys) =>
|
| | | {
|
| | | //变更网关房间
|
| | | HdlGatewayLogic.Current.ChangedGatewayRoom(this.zbGateway, roomKeys);
|
| | | };
|
| | |
|
| | | //所属住宅
|
| | | caption = Language.StringByID(R.MyInternationalizationString.uBelongResidence);
|
| | | var btnBeloneArea = new FrameCaptionViewControl(caption, Common.Config.Instance.Home.Name, listview.rowSpace / 2);
|
| | | btnBeloneArea.UseClickStatu = false;
|
| | | listview.AddChidren(btnBeloneArea);
|
| | | btnBeloneArea.InitControl();
|
| | | //划线
|
| | | btnBeloneArea.AddBottomLine();
|
| | |
|
| | | //数据上传与下载
|
| | | var rowData = new RowLayoutControl(listview.rowSpace / 2);
|
| | |
| | | rowData.frameTable.AddBottomLine();
|
| | | rowData.frameTable.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GatewayUploadAndDownLoadForm();
|
| | | form.AddForm(HdlGatewayLogic.Current.GetGatewayId(this.zbGateway));
|
| | | };
|
| | |
|
| | | //通用信息
|
| | |
| | | rowUpDate.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnNewVersion.Visible = false;
|
| | | var form = new GatewayUpdate.GatewayFirmwareUpdateForm();
|
| | | form.AddForm(zbGateway);
|
| | | };
|
| | |
|
| | | //初始化桌布完成
|
| | | tableContr.FinishInitControl(bodyFrameLayout, this.listview);
|
| | | tableContr.FinishInitControl();
|
| | | tableContr = null;
|
| | |
|
| | | //保存
|
| | |
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //检测新版本
|
| | | this.CheckNewVersion(btnNewVersion, btnType);
|
| | | this.CheckNewVersion(btnNewVersion);
|
| | | });
|
| | | }
|
| | |
|
| | |
| | | private void ShowTopRightMenu()
|
| | | {
|
| | | bool flage = UserCenterResourse.DicActionForm.ContainsKey("NewGateWayMenuSelectForm");
|
| | | var frame = new TopRightMenuControl(flage == true ? 1 : 3);
|
| | | var frame = new TopRightMenuControl(flage == true ? 1 : 3, 1);
|
| | | //定位
|
| | | string MenuName = Language.StringByID(R.MyInternationalizationString.uFixedPosition);
|
| | | frame.AddRowMenu(MenuName, "Item/FixedPosition.png", "Item/FixedPositionSelected.png", () =>
|
| | |
| | | /// 检测新版本
|
| | | /// </summary>
|
| | | /// <param name="btnNewVersion">提示有新版本的控件</param>
|
| | | /// <param name="btnType">网关类型控件</param>
|
| | | private async void CheckNewVersion(PicViewControl btnNewVersion, FrameCaptionViewControl btnType)
|
| | | private async void CheckNewVersion(PicViewControl btnNewVersion)
|
| | | {
|
| | | //获取网关版本信息
|
| | | var result = await HdlGatewayLogic.Current.GetGatewayAllNewVersion(this.zbGateway);
|
| | |
| | | {
|
| | | if (this.Parent != null)
|
| | | {
|
| | | HdlGatewayLogic.Current.SetGatewayImageText(btnType.txtView, this.zbGateway);
|
| | | if (result[0] != null || result[1] != null || result[2] != null)
|
| | | {
|
| | | //提示有新版本
|
| | |
| | | this.CloseForm();
|
| | |
|
| | | //关闭指定界面(网关搜索)
|
| | | this.CloseFormByFormName("WiredGatewayListForm");
|
| | | this.CloseFormByFormName("GatewaySearchListForm");
|
| | | this.CloseFormByFormName("NewGateWayMenuSelectForm");
|
| | |
|
| | | //关闭指定界面(网关编辑)
|
| | |
| | | /// </summary>
|
| | | /// <param name="strWayId"></param>
|
| | | /// <param name="row"></param>
|
| | | private async void DeleteGateway(string strWayId)
|
| | | private void DeleteGateway(string strWayId)
|
| | | {
|
| | | //删除云端网关
|
| | | bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
|
| | | if (result == false)
|
| | | HdlThreadLogic.Current.RunThread(async () =>
|
| | | {
|
| | | return;
|
| | | }
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
|
| | | }
|
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | //删除云端网关
|
| | | bool result = await HdlGatewayLogic.Current.DeleteGateway(strWayId);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | HdlGatewayLogic.Current.SaveGatewayIdToLocation(string.Empty);
|
| | | }
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //关闭自身
|
| | | this.CloseForm();
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|