| | |
| | | var btnSwicth = frameAuto.AddMostRightSwitchIcon();
|
| | | btnSwicth.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnSwicth.IsSelected = !btnSwicth.IsSelected;
|
| | | //设置状态
|
| | | if (HdlGatewayLogic.Current.SetGatewayAutoBackupStatu(this.realGateway, !btnSwicth.IsSelected) == true)
|
| | | {
|
| | | btnSwicth.IsSelected = !btnSwicth.IsSelected;
|
| | | }
|
| | | };
|
| | |
|
| | | //上传数据至云端
|
| | |
| | | frameDown.AddRightArrow();
|
| | | frameDown.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | if (this.realGateway == null)
|
| | | {
|
| | | //错误:网关对象丢失
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uErrorGatewayLostMsg);
|
| | | this.ShowMassage(ShowMsgType.Error, msg);
|
| | | return;
|
| | | }
|
| | | var form = new GatewayBackUpListForm();
|
| | | form.AddForm(this.realGateway);
|
| | | };
|
| | | //调整真实高度
|
| | | listView.AdjustRealHeight(Application.GetRealHeight(23));
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //获取网关数据
|
| | | this.GetGatewayData(btnSwicth);
|
| | | });
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 一般方法___________________________
|
| | | #region ■ 获取数据___________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 获取网关数据
|
| | | /// </summary>
|
| | | /// <param name="btnSwitch"></param>
|
| | | private void GetGatewayData(MostRightIconControl btnSwitch)
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | |
|
| | | //获取网关自动设置状态
|
| | | var statu = HdlGatewayLogic.Current.GetGatewayAutoBackupStatu(realGateway);
|
| | | if (statu == -1)
|
| | | {
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return;
|
| | | }
|
| | | if (statu == 1)
|
| | | {
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | btnSwitch.IsSelected = true;
|
| | | });
|
| | | }
|
| | |
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|