New file |
| | |
| | | using System;
|
| | | using System.Collections.Generic;
|
| | | using System.Text;
|
| | |
|
| | | namespace Shared.Phone.UserCenter.GatewayAdd
|
| | | {
|
| | | /// <summary>
|
| | | /// 无线网关UDP模式的选择网络界面
|
| | | /// </summary>
|
| | | public class WirelessUdpSelectNetworkForm : EditorCommonForm
|
| | | {
|
| | | #region ■ 变量声明___________________________
|
| | |
|
| | | #endregion
|
| | |
|
| | | #region ■ 初始化_____________________________
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | public void ShowForm()
|
| | | {
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddWirelessGateway));
|
| | |
|
| | | HdlThreadLogic.Current.RunThread(() =>
|
| | | {
|
| | | //打开进度条
|
| | | this.ShowProgressBar();
|
| | | var ssid = HdlWifiLogic.Current.SSID;
|
| | | if (ssid == null)
|
| | | {
|
| | | //获取网络SSID失败
|
| | | string msg = Language.StringByID(R.MyInternationalizationString.uGetSsidFail);
|
| | | this.ShowMassage(ShowMsgType.Tip, msg);
|
| | | //关闭进度条
|
| | | this.CloseProgressBar(ShowReLoadMode.YES);
|
| | | return;
|
| | | }
|
| | | //关闭进度条
|
| | | this.CloseProgressBar();
|
| | |
|
| | | HdlThreadLogic.Current.RunMain(() =>
|
| | | {
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame(ssid);
|
| | | });
|
| | | });
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame(string ssid)
|
| | | {
|
| | | bodyFrameLayout.RemoveAll();
|
| | |
|
| | | var frameBack = new FrameLayout();
|
| | | frameBack.Height = Application.GetRealHeight(409);
|
| | | frameBack.BackgroundColor = UserCenterColor.Current.White;
|
| | | bodyFrameLayout.AddChidren(frameBack);
|
| | |
|
| | | //请选择网络
|
| | | var btnTitle = new NormalViewControl(600, 64, true);
|
| | | btnTitle.X = ControlCommonResourse.XXLeft;
|
| | | btnTitle.Y = Application.GetRealHeight(30);
|
| | | btnTitle.TextSize = 15;
|
| | | btnTitle.TextID = R.MyInternationalizationString.uPleaseSelectNetwork;
|
| | | frameBack.AddChidren(btnTitle);
|
| | |
|
| | | //WIFI
|
| | | var rowWifi = new FrameCaptionViewControl("WiFi", ssid);
|
| | | rowWifi.UseClickStatu = false;
|
| | | rowWifi.Y = Application.GetRealHeight(124);
|
| | | frameBack.AddChidren(rowWifi);
|
| | | rowWifi.InitControl();
|
| | | rowWifi.AddBottomLine();
|
| | |
|
| | | //密码
|
| | | var btnPsw = new FrameCaptionInputControl(Language.StringByID(R.MyInternationalizationString.uPassword), string.Empty);
|
| | | btnPsw.Y = rowWifi.Bottom + Application.GetRealHeight(9);
|
| | | frameBack.AddChidren(btnPsw);
|
| | | btnPsw.InitControl();
|
| | | btnPsw.txtInput.SecureTextEntry = true;
|
| | | btnPsw.txtInput.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
|
| | | var btnView = btnPsw.AddMostRightEmptyIcon(81, 81);
|
| | | btnView.UnSelectedImagePath = "Item/HidenPWD.png";
|
| | | btnView.SelectedImagePath = "Item/UnHidenPWD.png";
|
| | | btnPsw.ChangedChidrenBindMode(btnView, ChidrenBindMode.NotBind);
|
| | | btnView.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | btnView.IsSelected = !btnView.IsSelected;
|
| | | btnPsw.txtInput.SecureTextEntry = !btnPsw.txtInput.SecureTextEntry;
|
| | | };
|
| | |
|
| | | var btnMsg = new NormalViewControl(btnPsw.txtInput.Width, false);
|
| | | btnMsg.X = ControlCommonResourse.XXLeft;
|
| | | btnMsg.Y = frameBack.Bottom + Application.GetRealHeight(23);
|
| | | btnMsg.TextSize = 12;
|
| | | btnMsg.Height = Application.GetRealHeight(40);
|
| | | btnMsg.TextColor = UserCenterColor.Current.ErrorColor;
|
| | | bodyFrameLayout.AddChidren(btnMsg);
|
| | |
|
| | | //查看帮助
|
| | | var btnHelp = this.AddHelpControl();
|
| | | btnHelp.ButtonClickEvent += (sender, e) =>
|
| | | {
|
| | | var form = new AddGatewayHelpForm();
|
| | | form.AddForm("Udp");
|
| | | };
|
| | |
|
| | | //下一步
|
| | | var btnNext = new BottomClickButton();
|
| | | btnNext.TextID = R.MyInternationalizationString.uNextway;
|
| | | bodyFrameLayout.AddChidren(btnNext);
|
| | |
|
| | | btnNext.MouseUpEventHandler += (sender, e) =>
|
| | | {
|
| | | btnMsg.Text = string.Empty;
|
| | | if (btnPsw.Text == string.Empty)
|
| | | {
|
| | | //请输入Wifi密码
|
| | | btnMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInputWifiPassword);
|
| | | return;
|
| | | }
|
| | | //开始Wi-Fi配网
|
| | | HdlWifiLogic.Current.StartSmartConnection(rowWifi.Text, btnPsw.Text, "");
|
| | | var form = new WirelessUdpSearchForm();
|
| | | this.AddFromAndRemoveNowForm(form);
|
| | | };
|
| | | }
|
| | |
|
| | | #endregion
|
| | | }
|
| | | }
|