黄学彪
2019-10-28 8b4d79ca03495e522a1953e04ca17527f33c853a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter.GatewayAdd
{
    /// <summary>
    /// 无线网关按下按钮界面
    /// </summary>
    public class WirelessGwClickButtonForm : EditorCommonForm
    {
        #region ■ 变量声明___________________________
 
        /// <summary>
        /// 停止连接
        /// </summary>
        private bool stopConnection = true;
 
        #endregion
 
        #region ■ 初始化_____________________________
 
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        public void ShowForm()
        {
            //设置标题信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddWirelessGateway));
 
            //初始化中部控件
            this.InitMiddleFrame();
        }
 
        /// <summary>
        /// 初始化中部控件
        /// </summary>
        private void InitMiddleFrame()
        {
            //图标
            var btnimage = new PicViewControl(403, 371, true);
            btnimage.Y = Application.GetRealHeight(386);
            btnimage.Gravity = Gravity.CenterHorizontal;
            btnimage.UnSelectedImagePath = "Gateway/WirelessGatewayImage.png";
            bodyFrameLayout.AddChidren(btnimage);
 
            //请点按无线网关上的XX键
            var btnMsg1 = new NormalViewControl(bodyFrameLayout.Width, false);
            btnMsg1.TextID = R.MyInternationalizationString.uWirelessGatewayButtonClick1;
            btnMsg1.Y = btnimage.Bottom + Application.GetRealHeight(213);
            btnMsg1.TextAlignment = TextAlignment.Center;
            bodyFrameLayout.AddChidren(btnMsg1);
            //使网关进入配网状态
            var btnMsg2 = new NormalViewControl(bodyFrameLayout.Width, false);
            btnMsg2.TextID = R.MyInternationalizationString.uWirelessGatewayButtonClick2;
            btnMsg2.TextAlignment = TextAlignment.Center;
            btnMsg2.Y = btnMsg1.Bottom;
            bodyFrameLayout.AddChidren(btnMsg2);
 
            //下一步
            var btnNext = new BottomClickButton();
            btnNext.TextID = R.MyInternationalizationString.uNextway;
            bodyFrameLayout.AddChidren(btnNext);
 
            btnNext.MouseUpEventHandler += (sender, e) =>
            {
                //不中断连接
                this.stopConnection = false;
 
                var form = new WirelessGatewaySearchForm();
                this.AddFromAndRemoveNowForm(form);
            };
        }
 
        #endregion
 
        #region ■ 界面关闭___________________________
 
        /// <summary>
        /// 界面关闭
        /// </summary>
        public override void CloseForm()
        {
            if (stopConnection == true)
            {
                //停止Wi-Fi配网
                //Com.Mediatek.Elian.ElianNative.StopSmartConnection();
            }
            base.CloseForm();
        }
 
        #endregion
    }
}