HDL Home App 第二版本 旧平台金堂用 正在使用
黄学彪
2019-11-13 8b9ce384b26c414db32f98e94e088f5334869c2d
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
using System;
namespace Shared.Phone.UserCenter.GatewayAdd
{
    /// <summary>
    /// 添加网关的选择画面
    /// </summary>
    public class NewGateWayMenuSelectForm : EditorCommonForm
    {
        /// <summary>
        /// 画面显示(底层会固定调用此方法,借以完成画面创建)
        /// </summary>
        public void ShowForm()
        {
            //设置头部信息
            base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddGateway));
 
            //初始化中部信息
            this.InitMiddleFrame();
        }
 
        /// <summary>
        /// 初始化中部信息
        /// </summary>
        private void InitMiddleFrame()
        {
            //清空bodyFrame
            this.ClearBodyFrame();
 
            var listView = new VerticalListControl(29);
            listView.Height = Application.GetRealHeight(340);
            listView.BackgroundColor = UserCenterColor.Current.White;
            bodyFrameLayout.AddChidren(listView);
 
            //有线网关
            var row1 = new FrameRowControl(listView.rowSpace / 2);
            listView.AddChidren(row1);
            var btnIcon1 = row1.AddLeftIcon(81);
            btnIcon1.UnSelectedImagePath = "Gateway/WiredGateway.png";
            var btntext1 = row1.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uWiredGateway), 500);
            btntext1.TextSize = 15;
            row1.AddRightArrow();
            row1.AddBottomLine();
            row1.ButtonClickEvent += (sender, e) =>
            {
                var form = new WiredGatewayDirectionForm();
                form.AddForm();
            };
 
            //无线网关
            var row2 = new FrameRowControl(listView.rowSpace / 2);
            listView.AddChidren(row2);
            var btnIcon2 = row2.AddLeftIcon(81);
            btnIcon2.UnSelectedImagePath = "Gateway/WirelessGateway.png";
            var btntext2 = row2.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.uWirelessGateway), 500);
            btntext2.TextSize = 15;
            row2.AddRightArrow();
            row2.ButtonClickEvent += (sender, e) =>
            {
                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();
                });
            };
        }
 
        /// <summary>
        /// 菜单控件
        /// </summary>
        private class SearchWirelessMenuControl : DialogCommonForm
        {
            /// <summary>
            /// 画面显示(底层会固定调用此方法,借以完成画面创建)
            /// </summary>
            public void ShowForm()
            {
                var frameBack1 = new FrameLayoutControl();
                frameBack1.UseClickStatu = false;
                frameBack1.Y = Application.GetRealHeight(1420);
                frameBack1.Gravity = Gravity.CenterHorizontal;
                frameBack1.RadiusEx = 12;
                frameBack1.Width = Application.GetRealWidth(1034);
                frameBack1.Height = Application.GetRealHeight(300);
                frameBack1.BackgroundColor = UserCenterColor.Current.White;
                bodyFrameLayout.AddChidren(frameBack1);
 
                //UDP模式(推荐)
                var btnUdp = new NormalViewControl(900, 156, true);
                btnUdp.Gravity = Gravity.CenterHorizontal;
                btnUdp.TextAlignment = TextAlignment.Center;
                btnUdp.TextColor = 0xff0075ff;
                btnUdp.TextSize = 17;
                btnUdp.TextID = R.MyInternationalizationString.uUdpModeRecommend;
                frameBack1.AddChidren(btnUdp, ChidrenBindMode.NotBind);
                btnUdp.ButtonClickEvent += (sender, e) =>
                {
                    //关闭界面
                    this.CloseForm();
                    var form = new WirelessUdpDirectionForm();
                    form.AddForm();
                };
 
                //线
                var btnLine = new NormalViewControl(frameBack1.Width, ControlCommonResourse.BottomLineHeight, false);
                btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
                btnLine.Y = btnUdp.Bottom;
                frameBack1.AddChidren(btnLine, ChidrenBindMode.NotBind);
                //AP模式
                var btnAp = new NormalViewControl(900, 144, true);
                btnAp.Y = btnLine.Bottom;
                btnAp.Gravity = Gravity.CenterHorizontal;
                btnAp.TextAlignment = TextAlignment.Center;
                btnAp.TextColor = 0xff0075ff;
                btnAp.TextSize = 17;
                btnAp.TextID = R.MyInternationalizationString.uApMode;
                frameBack1.AddChidren(btnAp, ChidrenBindMode.NotBind);
                btnAp.ButtonClickEvent += (sender, e) =>
                {
                    //关闭界面
                    this.CloseForm();
                    var form = new WirelessApDirection1Form();
                    form.AddForm();
                };
 
                var frameBack2 = new FrameLayoutControl();
                frameBack2.UseClickStatu = false;
                frameBack2.Y = frameBack1.Bottom + Application.GetRealHeight(23);
                frameBack2.Gravity = Gravity.CenterHorizontal;
                frameBack2.RadiusEx = 12;
                frameBack2.Width = Application.GetRealWidth(1034);
                frameBack2.Height = Application.GetRealHeight(156);
                frameBack2.BackgroundColor = UserCenterColor.Current.White;
                bodyFrameLayout.AddChidren(frameBack2);
                //取消
                var btnCancel = new NormalViewControl(900, 156, true);
                btnCancel.Gravity = Gravity.CenterHorizontal;
                btnCancel.TextAlignment = TextAlignment.Center;
                btnCancel.TextColor = 0xff0075ff;
                btnCancel.TextSize = 17;
                btnCancel.TextID = R.MyInternationalizationString.uCancel;
                frameBack2.AddChidren(btnCancel, ChidrenBindMode.NotBind);
                btnCancel.ButtonClickEvent += (sender, e) =>
                {
                    //关闭界面
                    this.CloseForm();
                };
            }
        }
    }
}