using System; using System.Collections.Generic; using System.Text; namespace Shared.Phone.UserCenter.GatewayAdd { /// /// Mini网关的说明指示界面1 /// public class MiniGatewayDirection2Form : EditorCommonForm { #region ■ 初始化_____________________________ /// /// 画面显示(底层会固定调用此方法,借以完成画面创建) /// public void ShowForm() { //设置头部信息 base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddMiniGateway)); //初始化中部信息 this.InitMiddleFrame(); } /// /// 初始化中部信息 /// private void InitMiddleFrame() { //清空bodyFrame this.ClearBodyFrame(); //下一步 var btnNext = new BottomClickButton(); btnNext.TextID = R.MyInternationalizationString.uNextway; bodyFrameLayout.AddChidren(btnNext); btnNext.ButtonClickEvent += (sender, e) => { //如果不是热点模式 if (HdlWifiLogic.Current.IsMiniGatewayHotspot == false) { //请选择hdlZigbeeGW-xxxx网络 this.ShowMassage(ShowMsgType.Tip, Language.StringByID(R.MyInternationalizationString.uPleaseSelectGatewayXXNet)); return; } var errorMsg = HdlWifiLogic.Current.StartApTcpConnection(); if (errorMsg != null) { //拥有错误 this.ShowMassage(ShowMsgType.Tip, errorMsg); return; } this.CloseForm(); var form = new MiniGatewaySelectNetworkForm(); form.AddForm(); }; //如果不是Mini网关热点 if (HdlWifiLogic.Current.IsMiniGatewayHotspot == false) { btnNext.Visible = false; } //图片 var framePic = new FrameLayout(); framePic.Width = this.GetPictrueRealSize(852); framePic.Height = this.GetPictrueRealSize(478); framePic.Gravity = Gravity.CenterHorizontal; framePic.Y = Application.GetRealHeight(285); framePic.BackgroundImagePath = "Gateway/WirelessGatewaySearching.png"; bodyFrameLayout.AddChidren(framePic); //手机去设置连接网关热点{0}即hdlZigbeeGW-xxxx,密码hdl123456{0}可查看网关背面标签查看热点名字和密码 string[] ArryMsg = Language.StringByID(R.MyInternationalizationString.uAddApWirelessGatewayMsg2).Split(new string[] { "{0}" }, StringSplitOptions.RemoveEmptyEntries); int yy = framePic.Bottom + Application.GetRealHeight(213); foreach (var msg in ArryMsg) { var btnMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false); btnMsg.Text = msg; btnMsg.Y = yy; btnMsg.TextAlignment = TextAlignment.Center; btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3; bodyFrameLayout.AddChidren(btnMsg); yy = btnMsg.Bottom; } //去设置 var btnSettion = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(50), false); btnSettion.Y = yy + Application.GetRealHeight(12); btnSettion.TextSize = 12; btnSettion.TextAlignment = TextAlignment.Center; btnSettion.TextColor = 0xff0075ff; btnSettion.Text = Language.StringByID(R.MyInternationalizationString.uGotoSettion); btnSettion.ButtonClickEvent += (sender, e) => { HdlWifiLogic.Current.OpenAppWifiSettion(); btnNext.Visible = true; }; bodyFrameLayout.AddChidren(btnSettion); //底线 int lineWidth = btnSettion.GetRealWidthByText(); var btnLine1 = new NormalViewControl(lineWidth, HdlControlResourse.BottomLineHeight, false); btnLine1.BackgroundColor = 0xff0075ff; btnLine1.Gravity = Gravity.CenterHorizontal; btnLine1.Y = btnSettion.Bottom - Application.GetRealHeight(8); bodyFrameLayout.AddChidren(btnLine1); //查看帮助 var btnHelp = this.AddHelpControl(); btnHelp.ButtonClickEvent += (sender, e) => { var form = new AddGatewayHelpForm(); form.AddForm("Mini"); }; } #endregion } }