gxc
2020-01-02 00ab3ddb140ba8bb88b5cf572b004a85e1da85e9
ZigbeeApp/Shared/Phone/UserCenter/Gateway/Manage/GatewayBackUpListForm.cs
@@ -93,6 +93,15 @@
            //进度条
            this.ShowProgressBar();
            //获取自动备份的数据
            var pageAuto = await HdlBackupLogic.Current.GetBackupListNameFromDB(3, HdlGatewayLogic.Current.GetGatewayId(realGateway));
            if (pageAuto == null)
            {
                //关闭进度条
                this.CloseProgressBar(ShowReLoadMode.YES);
                return;
            }
            //从云端获取数据 
            var pageData = await HdlBackupLogic.Current.GetBackupListNameFromDB(2, HdlGatewayLogic.Current.GetGatewayId(realGateway));
            if (pageData == null)
@@ -108,14 +117,24 @@
            {
                listView.RemoveAll();
                listView.RecoverHeight();
                //自动备份的ID
                string autoID = string.Empty;
                if (pageAuto.Count > 0)
                {
                    autoID = pageAuto[0].Id;
                    //添加自动备份行
                    this.AddRowlayout(pageAuto[0], pageData.Count > 0, true);
                }
                for (int i = 0; i < pageData.Count; i++)
                {
                    //添加备份行
                    this.AddRowlayout(pageData[i], i != pageData.Count - 1);
                    this.AddRowlayout(pageData[i], i != pageData.Count - 1, false);
                }
                this.btnDownload?.RemoveFromParent();
                if (pageData.Count > 0)
                if (pageData.Count > 0 || pageAuto.Count > 0)
                {
                    //下载
                    this.btnDownload = new BottomClickButton();
@@ -134,7 +153,7 @@
                             HdlThreadLogic.Current.RunThread(() =>
                             {
                                 //读取备份文档
                                 bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId);
                                 bool result = HdlGatewayBackupLogic.Current.RecoverGateway(this.realGateway, this.nowSelectBackId, autoID == this.nowSelectBackId ? 1 : 0);
                                 if (result == true)
                                 {
                                     HdlThreadLogic.Current.RunMain(() =>
@@ -149,7 +168,6 @@
                    //调整真实高度
                    listView.AdjustRealHeightByBottomButton(Application.GetRealHeight(23));
                }
            });
        }
@@ -162,7 +180,8 @@
        /// </summary>
        /// <param name="fileInfo"></param>
        /// <param name="addLine"></param>
        private void AddRowlayout(BackupListNameInfo fileInfo, bool addLine)
        /// <param name="isAuto"></param>
        private void AddRowlayout(BackupListNameInfo fileInfo, bool addLine, bool isAuto)
        {
            var rowLayout = new RowLayoutControl(listView.rowSpace / 2);
            listView.AddChidren(rowLayout);
@@ -172,6 +191,11 @@
            txtText.TextSize = 15;
            txtText.Y = Application.GetRealHeight(12) + rowLayout.chidrenYaxis;
            rowLayout.frameTable.AddChidren(txtText, ChidrenBindMode.BindEventOnly);
            if (isAuto == true)
            {
                txtText.TextID = R.MyInternationalizationString.uAutoBackup;
            }
            //时间 2019-11-11T11:31:01
            var btnTime = rowLayout.frameTable.AddLeftCaption("", 600, 50, true);
            btnTime.Y = Application.GetRealHeight(72) + rowLayout.chidrenYaxis;
@@ -211,13 +235,17 @@
                }
            };
            //编辑
            var btnEditor = rowLayout.AddEditorControl();
            btnEditor.ButtonClickEvent += (sender, e) =>
            //自动备份不允许编辑
            if (isAuto == false)
            {
                //显示编辑备考名画面
                this.ShowEditorBackupForm(fileInfo);
            };
                //编辑
                var btnEditor = rowLayout.AddEditorControl();
                btnEditor.ButtonClickEvent += (sender, e) =>
                {
                    //显示编辑备考名画面
                    this.ShowEditorBackupForm(fileInfo);
                };
            }
            //删除
            var btnDelete = rowLayout.AddDeleteControl();