| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | | using System.Threading.Tasks;
|
| | | using ZigBee.Device;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.GatewayManage
|
| | |
| | | //设置标题信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uGatewayManagement));
|
| | |
|
| | | //添加图标
|
| | | var btnAdd = new MostRightIconControl(69, 69);
|
| | | btnAdd.UnSelectedImagePath = "Item/Add.png";
|
| | | topFrameLayout.AddChidren(btnAdd);
|
| | | btnAdd.InitControl();
|
| | | btnAdd.ButtonClickEvent += (sender, e) =>
|
| | | //展示模板不允许编辑
|
| | | if (Config.Instance.Home.IsShowTemplate == false)
|
| | | {
|
| | | var form = new GatewayAdd.NewGateWayMenuSelectForm();
|
| | | form.AddForm();
|
| | | };
|
| | | //添加图标
|
| | | var btnAdd = new MostRightIconControl(69, 69);
|
| | | btnAdd.UnSelectedImagePath = "Item/Add.png";
|
| | | topFrameLayout.AddChidren(btnAdd);
|
| | | btnAdd.InitControl();
|
| | | btnAdd.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new GatewayAdd.NewGateWayMenuSelectForm();
|
| | | form.AddForm();
|
| | | };
|
| | | }
|
| | |
|
| | | //初始化中部控件
|
| | | this.InitMiddleFrame();
|
| | |
| | | //调整列表控件的高度
|
| | | this.listview.AdjustRealHeight(Application.GetRealHeight(23));
|
| | |
|
| | | //开启网关在线监测的线程
|
| | | this.StartGatewayOnlieCheckThread(listway);
|
| | | //如果是展示模板的话,不需要检测
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == false)
|
| | | {
|
| | | //开启网关在线监测的线程
|
| | | this.StartGatewayOnlieCheckThread(listway);
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | form.AddForm(gateway);
|
| | | };
|
| | |
|
| | | //切换
|
| | | var btnSwitch = new NormalViewControl(Application.GetRealWidth(184), gatewayRow.Height, false);
|
| | | btnSwitch.BackgroundColor = 0xfffb744a;
|
| | | btnSwitch.TextAlignment = TextAlignment.Center;
|
| | | btnSwitch.TextColor = UserCenterColor.Current.White;
|
| | | btnSwitch.TextSize = 12;
|
| | | btnSwitch.TextID = R.MyInternationalizationString.uSwitch1;
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | //如果是展示模板的话,不能编辑
|
| | | if (Common.Config.Instance.Home.IsShowTemplate == true)
|
| | | {
|
| | | btnSwitch.TextID = R.MyInternationalizationString.uRefresh;
|
| | | return;
|
| | | }
|
| | | gatewayRow.AddRightView(btnSwitch);
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | |
|
| | | //非虚拟住宅,才有这个功能
|
| | | if (Common.Config.Instance.Home.IsVirtually == false)
|
| | | {
|
| | | //是否切换到{0}网关?
|
| | | string msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToSwitchTheGateway), "[" + gatewayRow.btnName.Text + "]");
|
| | | //切换
|
| | | var btnSwitch = new NormalViewControl(Application.GetRealWidth(184), gatewayRow.Height, false);
|
| | | btnSwitch.BackgroundColor = 0xfffb744a;
|
| | | btnSwitch.TextAlignment = TextAlignment.Center;
|
| | | btnSwitch.TextColor = UserCenterColor.Current.White;
|
| | | btnSwitch.TextSize = 12;
|
| | | btnSwitch.TextID = R.MyInternationalizationString.uSwitch1;
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | //是否重新刷新{0}网关?
|
| | | msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToRefreshTheGateway), "[" + gatewayRow.btnName.Text + "]");
|
| | | btnSwitch.TextID = R.MyInternationalizationString.uRefresh;
|
| | | }
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | gatewayRow.AddRightView(btnSwitch);
|
| | | btnSwitch.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | //是否切换到{0}网关?
|
| | | string msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToSwitchTheGateway), "[" + gatewayRow.btnName.Text + "]");
|
| | | if (strWayId == GatewayResourse.AppOldSelectGatewayId)
|
| | | {
|
| | | //执行切换网关操作
|
| | | this.DoSwitchGateway(strWayId);
|
| | | //是否重新刷新{0}网关?
|
| | | msg = string.Format(Language.StringByID(R.MyInternationalizationString.uConfirmWantToRefreshTheGateway), "[" + gatewayRow.btnName.Text + "]");
|
| | | }
|
| | | this.ShowMassage(ShowMsgType.Confirm, msg, () =>
|
| | | {
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //执行切换网关操作
|
| | | this.DoSwitchGateway(strWayId);
|
| | | });
|
| | | });
|
| | | });
|
| | | };
|
| | | };
|
| | | }
|
| | |
|
| | | //定位
|
| | | var btnPosition = gatewayRow.AddEditorControl(false);
|