| | |
| | | row1.AddBottomLine();
|
| | | row1.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //检测住宅经纬度
|
| | | if (this.CheckResidencePoint() == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var form = new WiredGatewayDirectionForm();
|
| | | form.AddForm();
|
| | | //菜单按钮的点击事件
|
| | | this.MenuButtonClickEvent(1);
|
| | | };
|
| | |
|
| | | //无线网关
|
| | |
| | | row2.AddBottomLine();
|
| | | row2.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //检测住宅经纬度
|
| | | if (this.CheckResidencePoint() == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var menuContr = new BottomMenuSelectForm();
|
| | | menuContr.AddForm(2);
|
| | | //UDP模式(推荐)
|
| | | menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uUdpModeRecommend), () =>
|
| | | {
|
| | | var form = new WirelessUdpDirectionForm();
|
| | | form.AddForm();
|
| | | });
|
| | | //AP模式
|
| | | menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uApMode), () =>
|
| | | {
|
| | | var form = new WirelessApDirection1Form();
|
| | | form.AddForm();
|
| | | });
|
| | | //菜单按钮的点击事件
|
| | | this.MenuButtonClickEvent(2);
|
| | | }; |
| | | |
| | | //Mini网关 |
| | |
| | | row3.AddRightArrow();
|
| | | row3.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | //检测住宅经纬度
|
| | | if (this.CheckResidencePoint() == false)
|
| | | {
|
| | | return;
|
| | | }
|
| | | var form = new MiniGatewayDirection1Form();
|
| | | form.AddForm();
|
| | | //菜单按钮的点击事件
|
| | | this.MenuButtonClickEvent(3);
|
| | | }; |
| | | listView.AdjustRealHeight(Application.GetRealHeight(23)); |
| | | |
| | |
| | | btnTip.Text = Language.StringByID(R.MyInternationalizationString.uNotSetLocationWillAffectTheAutomaticGeofencingFunction);
|
| | | frameTip.AddChidren(btnTip);
|
| | | } |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ■ 按键点击___________________________ |
| | | |
| | | /// <summary> |
| | | /// 菜单按钮的点击事件 |
| | | /// </summary> |
| | | /// <param name="menuDiv">1:有线网关 2:无线网关 3:mini网关</param> |
| | | private void MenuButtonClickEvent(int menuDiv) |
| | | { |
| | | //只弹一次 |
| | | if (this.showSettion == true && Common.Config.Instance.Home.Latitude == 0 && Common.Config.Instance.Home.Longitude == 0) |
| | | { |
| | | this.showSettion = false; |
| | | //请前往住宅管理{0}设置住宅的地理位置 |
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGotoResidenceAndSetLocation).Replace("{0}", "\r\n"); |
| | | var alert = new ShowMsgControl(ShowMsgType.Confirm, msg, |
| | | Language.StringByID(R.MyInternationalizationString.uGotoSettion), |
| | | Language.StringByID(R.MyInternationalizationString.uNeglect)); |
| | | alert.Show(); |
| | | |
| | | //忽略 |
| | | alert.CancelClickEvent += () => |
| | | { |
| | | //显示指定的界面 |
| | | this.ShowFormByMenuDiv(menuDiv); |
| | | }; |
| | | //去设置 |
| | | alert.ConfirmClickEvent += () => |
| | | { |
| | | var form = new Residence.ResidenceManagementForm(); |
| | | form.AddForm(false); |
| | | }; |
| | | return; |
| | | } |
| | | //显示指定的界面 |
| | | this.ShowFormByMenuDiv(menuDiv); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 显示指定的界面 |
| | | /// </summary> |
| | | /// <param name="menuDiv">1:有线网关 2:无线网关 3:mini网关</param> |
| | | private void ShowFormByMenuDiv(int menuDiv) |
| | | { |
| | | if (menuDiv == 1) |
| | | { |
| | | var form = new WiredGatewayDirectionForm(); |
| | | form.AddForm(); |
| | | } |
| | | else if (menuDiv == 2) |
| | | { |
| | | var menuContr = new BottomMenuSelectForm(); |
| | | menuContr.AddForm(2); |
| | | //UDP模式(推荐) |
| | | menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uUdpModeRecommend), () => |
| | | { |
| | | var form = new WirelessUdpDirectionForm(); |
| | | form.AddForm(); |
| | | }); |
| | | //AP模式 |
| | | menuContr.AddMenu(Language.StringByID(R.MyInternationalizationString.uApMode), () => |
| | | { |
| | | var form = new WirelessApDirection1Form(); |
| | | form.AddForm(); |
| | | }); |
| | | } |
| | | else if (menuDiv == 3) |
| | | { |
| | | var form = new MiniGatewayDirection1Form(); |
| | | form.AddForm(); |
| | | } |
| | | }
|
| | |
|
| | | #endregion |