wei
2020-11-27 e53a1951d6aa07ad22aad9816da4703496fcbccd
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
using System;
using System.Text.RegularExpressions;
using System.Threading;
using HDL_ON.DAL.Server;
using HDL_ON.UI.CSS;
using Shared;
 
namespace HDL_ON.UI.UI1Login
{
    public partial class RegisterPage
    {
        /// <summary>
        /// 加载事件列表
        /// </summary>
        void LoadEventList()
        {
            LoadPage_SwitchRegisterType();
            LoadEvent_EditTextFcousChange();
            LoadEvent_ChangeTextVisble();
            LoadEvent_GetVerificationCode();
            LoadEvent_Register();
            LoadEvent_LimtPasswordLength();
            LoadEvent_TextChange();
            LoadEvent_Server();
            //var areaCodeList = pm.GetAreaCode();
        }
        /// <summary>
        /// 加载文本变化事件
        /// </summary>
        void LoadEvent_TextChange()
        {
            etAccount.TextChangeEventHandler = (sender, e) =>
            {
                //Regex reg = new Regex(@"^[1]+\d{10}");
                //var mFalg = reg.Match(etAccount.Text.Trim());
                if (registerType == 0)//手机注册获取验证码按钮生效条件
                {
                    if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode))
                    {
                        btnGetVerificationCode_Phone.IsSelected = false;
                    }
                    else
                    {
                        if (btnGetVerificationCode_Phone.Text == Language.StringByID(StringId.GetVerificationCode))
                            btnGetVerificationCode_Phone.IsSelected = true;
                    }
                }
                else//邮箱注册获取验证码按钮生效条件
                {
                    if (!Utlis.CheckEmail(etAccount.Text.Trim()))
                    {
                        btnGetVerificationCode_Mail.IsSelected = false;
                    }
                    else
                    {
                        if (btnGetVerificationCode_Mail.Text == Language.StringByID(StringId.GetVerificationCode))
                            btnGetVerificationCode_Mail.IsSelected = true;
                    }
                }
 
            };
        }
 
        /// <summary>
        /// 切换注册类型
        /// </summary>
        void LoadPage_SwitchRegisterType()
        {
            //选择手机注册
            btnPhoneLogin.MouseUpEventHandler = (sender, e) =>
            {
                if (registerType == 0)
                {
                    return;
                }
                etAccount.IsNumberKeyboardType = true;
                etAccount.Text = registerPhone;
                etPassword.Text = "";
                etRepeatPassword.Text = "";
                #region 切换选中按钮
                btnGetVerificationCode_Mail.Visible = false;
                btnGetVerificationCode_Phone.Visible = true;
                btnEmailLogin.TextColor = CSS_Color.PromptingColor1;
                btnEmailLogin.TextSize = CSS_FontSize.TextFontSize;
                btnPhoneLogin.TextColor = CSS_Color.MainColor;
                btnPhoneLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary;
                etAccount.PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber);
                #endregion
 
                #region 切换注册方式及图标
                registerType = 0;
                if (btnAccountIcon.Parent != null)
                {
                    btnAccountIcon.RemoveFromParent();
                }
                accountView.AddChidren(btnGlobalRoaming);
                #endregion
            };
 
            //选择邮箱注册
            btnEmailLogin.MouseUpEventHandler = (sender, e) =>
            {
                if (registerType == 1)
                    return;
 
                etAccount.IsNumberKeyboardType = false;
                etAccount.Text = registerEmail;
                etPassword.Text = "";
                etRepeatPassword.Text = "";
                #region 切换选中按钮
                btnGetVerificationCode_Mail.Visible = true;
                btnGetVerificationCode_Phone.Visible = false;
                btnPhoneLogin.TextColor = CSS_Color.PromptingColor1;
                btnPhoneLogin.TextSize = CSS_FontSize.TextFontSize;
                btnEmailLogin.TextColor = CSS_Color.MainColor;
                btnEmailLogin.TextSize = CSS_FontSize.EmphasisFontSize_Secondary;
                etAccount.PlaceholderText = Language.StringByID(StringId.PlsEntryEmailAddress);
                #endregion
 
                #region 切换注册类型及图标
                registerType = 1;
                if (btnGlobalRoaming.Parent != null)
                {
                    btnGlobalRoaming.RemoveFromParent();
                }
                accountView.AddChidren(btnAccountIcon);
                #endregion
 
            };
        }
 
        /// <summary>
        /// 加载文本框焦点变化事件
        /// </summary>
        void LoadEvent_EditTextFcousChange()
        {
            //账号文本框焦点变化事件
            etAccount.FoucsChanged += (sender, e) =>
            {
                if (etAccount.Foucs)
                {
                    btnAccountViewBottomLine.BackgroundColor = CSS_Color.MainColor;
                    btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
                }
                else
                {
                    //标记手机号码无效
                    btnAccountViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                    btnAccountViewBottomLine.Height = Application.GetRealHeight(1);
                    //手机注册-验证手机号码是否正确
                    if (etAccount.Text.Trim().Length > 0)
                    {
                        if (registerType == 0)
                        {
                            if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode))
                            {
                                btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                                btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
                                btnGetVerificationCode_Phone.IsSelected = false;
                                new Tip()
                                {
                                    CloseTime = 1,
                                    Text = Language.StringByID(StringId.PlsEntryCorrectMobilNeumber),
                                    Direction = AMPopTipDirection.None,
                                }.Show(bodyView);
                            }
                            else
                            {
                                if (btnGetVerificationCode_Phone.Text == Language.StringByID(StringId.GetVerificationCode))
                                {
                                    //标记手机号码有效
                                    btnGetVerificationCode_Phone.IsSelected = true;
                                }
                                //账号有效、密码有效、验证码输入了,才能点击注册
                                if (ValidPassword && !string.IsNullOrEmpty(etVerificationCode.Text.Trim()))
                                {
                                    btnRegister.IsSelected = true;
                                }
                            }
                        }
                        else if (registerType == 1)
                        {
                            //邮箱注册-验证邮箱是否正确
                            if (!Utlis.CheckEmail(etAccount.Text.Trim()))
                            {
                                btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                                btnAccountViewBottomLine.Height = Application.GetRealHeight(2);
                                btnGetVerificationCode_Mail.IsSelected = false;
                                new Tip()
                                {
                                    CloseTime = 1,
                                    Text = Language.StringByID(StringId.PlsEntryCorrectEmailAddress),
                                    Direction = AMPopTipDirection.None,
                                }.Show(bodyView);
                            }
                            else
                            {
                                if (btnGetVerificationCode_Mail.Text == Language.StringByID(StringId.GetVerificationCode))
                                {//标记手机号码有效
                                    btnGetVerificationCode_Mail.IsSelected = true;
                                }
                                //账号有效、密码有效、验证码输入了,才能点击注册
                                if (ValidPassword && string.IsNullOrEmpty(etVerificationCode.Text.Trim()))
                                {
                                    btnRegister.IsSelected = true;
                                }
                            }
                        }
                    }
                    if (accountType == 0)
                    {
                        registerPhone = etAccount.Text.Trim();
                    }
                    else
                    {
                        registerEmail = etAccount.Text.Trim();
                    }
                }
            };
 
            //密码文本框焦点变化事件
            etPassword.FoucsChanged += (sender, e) =>
            {
                if (etPassword.Foucs)
                {
                    btnPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor;
                    btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
                }
                else
                {
                    if (etPassword.Text.Length == 0)
                    {
                        btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                        btnPasswordViewBottomLine.Height = Application.GetRealHeight(1);
                        return;
                    }
                    //需要输入6位以上的密码
                    if (etPassword.Text.Length < 6 || etPassword.Text.Length > 13)
                    {
                        btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                        btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
 
                        new Tip()
                        {
                            CloseTime = 1,
                            Direction = AMPopTipDirection.None,
                            Text = Language.StringByID(StringId.PlsRegisterPassword)
                        }.Show(bodyView);
                    }
                    else
                    {
                        btnPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                        btnPasswordViewBottomLine.Height = Application.GetRealHeight(1);
                    }
                }
            };
 
            //确认密码文本框焦点变化事件
            etRepeatPassword.FoucsChanged += (sender, e) =>
            {
                if (etRepeatPassword.Foucs)
                {
                    btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.MainColor;
                    btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2);
                }
                else
                {
                    btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                    btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(1);
                    //校验两次输入的密码是否一致
                    if (etPassword.Text.Trim().Length > 5)
                    {
                        if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim())
                        {
                            btnRepeatPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                            btnRepeatPasswordViewBottomLine.Height = Application.GetRealHeight(2);
                            new Tip()
                            {
                                CloseTime = 1,
                                Direction = AMPopTipDirection.None,
                                Text = Language.StringByID(StringId.IncorrectRepeatPassword)
                            }.Show(bodyView);
                        }
                        else
                        {
                            ValidPassword = true;
                            //账号有效、密码有效、验证码输入了,才能点击注册
                            if (ValidPassword && !string.IsNullOrEmpty(etVerificationCode.Text.Trim()))
                            {
                                btnRegister.IsSelected = true;
                            }
                        }
                    }
                }
            };
 
            //验证码文本框焦点变化事件
            etVerificationCode.FoucsChanged += (sender, e) =>
            {
                if (etVerificationCode.Foucs)
                {
                    btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.MainColor;
                    btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
                }
                else
                {
                    btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                    btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(1);
                    if (etVerificationCode.Text.Length > 1)
                    {
                        //账号有效、密码有效、验证码输入了,才能点击注册
                        if (ValidPassword)
                        {
                            btnRegister.IsSelected = true;
                        }
                    }
                }
            };
        }
 
        /// <summary>
        /// 限制密码文本库输入长度
        /// </summary>
        void LoadEvent_LimtPasswordLength()
        {
            etPassword.TextChangeEventHandler = (sender, e) =>
            {
                if (etPassword.Text.Length > 16)
                {
                    etPassword.Text = etPassword.Text.Remove(15);
                }
            };
 
            etRepeatPassword.TextChangeEventHandler = (sender, e) =>
            {
                if (etRepeatPassword.Text.Length > 16)
                {
                    etRepeatPassword.Text = etRepeatPassword.Text.Remove(15);
                }
            };
        }
 
        /// <summary>
        /// 更改密码可见性
        /// </summary>
        void LoadEvent_ChangeTextVisble()
        {
            //密码文本可见性变化
            btnVisiblePassword.MouseUpEventHandler += (sender, e) =>
            {
                btnVisiblePassword.IsSelected = !btnVisiblePassword.IsSelected;
                etPassword.SecureTextEntry = !btnVisiblePassword.IsSelected;
            };
            //重复密码文本可见性变化
            btnRepeatVisiblePassword.MouseUpEventHandler += (sender, e) =>
            {
                btnRepeatVisiblePassword.IsSelected = !btnRepeatVisiblePassword.IsSelected;
                etRepeatPassword.SecureTextEntry = !btnRepeatVisiblePassword.IsSelected;
            };
        }
 
        /// <summary>
        /// 获取验证码
        /// </summary>
        void LoadEvent_GetVerificationCode()
        {
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                if ((sender as Button).IsSelected)
                {
                    //判断是否选择了服务器,选择了才能发送验证码
                    if (CheckIfSelectServer() == false) return;
 
                    string account = etAccount.Text.Trim();
                    int time = 60;
                    new Thread(() =>
                    {
                        //1.先检查账号是否注册过
                        var result = pm.GetRegionByAccount(account);
                        //2.账号不存在,才允许继续注册
                        if (result.Code == StateCode.ACCOUNT_NOT_EXIST)
                        {
                            //账号不存在 未注册允许发送验证码注册
                            Application.RunOnMainThread(() =>
                            {
                                //短信发送间隔60s
                                (sender as Button).IsSelected = false;
 
                            });
                            //2.1 开始倒计时
                            new Thread(() =>
                            {
                                while (time > 0)
                                {
                                    time--;
                                    Application.RunOnMainThread(() =>
                                    {
                                        (sender as Button).Text = time.ToString() + "s";
                                    });
                                    Thread.Sleep(1000);
                                }
                                Application.RunOnMainThread(() =>
                                {
                                    //回复获取短信按钮事件
                                    (sender as Button).IsSelected = true;
                                    (sender as Button).TextID = StringId.GetVerificationCode;
                                });
                            })
                            { IsBackground = true }.Start();
 
                            //2.2  获取验证码
                            ResponsePackNew resultObj;
                            if (registerType == 1)//邮箱
                            {
                                resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account);
                            }
                            else
                            {
                                resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode);
                            }
 
                            if (resultObj.Code != StateCode.SUCCESS)
                            {
                                // 提示错误
                                IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code);
                            }
 
                        }
                        else if (result.Code.ToUpper() == StateCode.SUCCESS)
                        {
                            //3.提示账号已存在,无法重复注册
                            Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse));
                        }
                        else
                        {
                            //4.提示其它异常错误
                            IMessageCommon.Current.ShowErrorInfoAlter(result.Code);
                        }
                    })
                    { IsBackground = true }.Start();
 
                    //(sender as Button).IsSelected = false;
                    //string account = etAccount.Text.Trim();
                    ////短信发送间隔60s
                    //int time = 60;
                    //new Thread(() =>
                    //{
                    //    while (time > 0)
                    //    {
                    //        time--;
                    //        Application.RunOnMainThread(() =>
                    //        {
                    //            (sender as Button).Text = time.ToString() + "s";
                    //        });
                    //        Thread.Sleep(1000);
                    //    }
                    //    Application.RunOnMainThread(() =>
                    //    {
                    //       //回复获取短信按钮事件
                    //       (sender as Button).IsSelected = true;
                    //        (sender as Button).TextID = StringId.GetVerificationCode;
                    //    });
                    //})
                    //{ IsBackground = true }.Start();
                    //new Thread(() =>
                    //{
                    //    ResponsePackNew resultObj;
                    //    // 获取验证码
                    //    if (registerType == 1)//邮箱
                    //    {
                    //         resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account);
                    //    }
                    //    else
                    //    {
                    //         resultObj = pm.VerificationCodeSend(VerifyType.REGISTER_USER, account, true, phoneZoneCode);
                    //    }
 
                    //    if (resultObj.Code != StateCode.SUCCESS_CODE)
                    //    {
                    //       // 提示错误
                    //       IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code);
                    //    }
                    //})
                    //{ IsBackground = true }.Start();
                }
            };
 
            btnGetVerificationCode_Phone.MouseDownEventHandler = eventHandler;
            btnGetVerificationCode_Mail.MouseDownEventHandler = eventHandler;
        }
 
        /// <summary>
        /// 加载注册按钮事件
        /// </summary>
        void LoadEvent_Register()
        {
            btnRegister.MouseUpEventHandler = (sender, e) =>
            {
                if (etPassword.Text.Trim().Length > 13 || etPassword.Text.Trim().Length < 6)
                {
                    new Tip()
                    {
                        CloseTime = 1,
                        Direction = AMPopTipDirection.None,
                        Text = Language.StringByID(StringId.PlsRegisterPassword)
                    }.Show(bodyView);
                    return;
                }
                if (btnRegister.IsSelected)
                {
                    //判断是否选择了服务器,选择了才能发送验证码
                    if (CheckIfSelectServer() == false) return;
 
                    waitPage = new Loading();
                    new PublicAssmebly().LoadPage_WaitPage(LoadMethod_RegisterThread(), bodyView, waitPage);
                }
            };
        }
 
        /// <summary>
        /// 加载注册方法
        /// </summary>
        Thread LoadMethod_RegisterThread()
        {
            string account = etAccount.Text.Trim();
            string password = etPassword.Text.Trim();
            string entryPassword = etRepeatPassword.Text.Trim();
            string verCode = etVerificationCode.Text.Trim();
            return new Thread(() =>
            {
                try
                {
                    //校验验证码并注册账号
                    var isPhone = registerType == 0;
                    var validateSmsResult = pm.ValidataCodeAndRegister(account, password, verCode, isPhone);
                    if (validateSmsResult.Code == StateCode.SUCCESS)
                    {
                        //注册成功
                        //执行回调事件
                        //callbackAction?.Invoke(account);
                        Application.RunOnMainThread(() =>
                        {
                            this.Close();
                            LoadEvent_AutoLogin(account, password);
                        });
                    }
                    else// 注册失败
                    {
                        // 提示错误
                        IMessageCommon.Current.ShowErrorInfoAlter(validateSmsResult.Code);
 
                        //2020-11-13 待修改
                        //string erorrInfo = "";
                        //switch (validateSmsResult.StateCode)
                        //{
                        //    case "Exist":
                        //        erorrInfo = Language.StringByID(StringId.AccountAlreadyUse);
                        //        break;
                        //    case "PwdNoConfirm":
                        //        erorrInfo = Language.StringByID(StringId.IncorrectRepeatPassword);
                        //        break;
                        //    case "ValidCodeAndPhoneNoEqual":
                        //        erorrInfo = Language.StringByID(StringId.VerificationCodeWrong);
                        //        break;
                        //    case "NoRecord":
                        //        erorrInfo = Language.StringByID(StringId.PlsGetTheVerificationCode);
                        //        Application.RunOnMainThread(() =>
                        //        {
                        //            btnVerificationCodeViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                        //            btnVerificationCodeViewBottomLine.Height = Application.GetRealHeight(2);
                        //        });
                        //        break;
                        //    default:
                        //        erorrInfo = Language.StringByID(StringId.RegistrationFailedPleaseTryAgain);
                        //        break;
                        //}
                        //Application.RunOnMainThread(() =>
                        //{
                        //    new Tip()
                        //    {
                        //        CloseTime = 1,
                        //        Direction = AMPopTipDirection.None,
                        //        Text = erorrInfo,
                        //    }.Show(bodyView);
                        //});
                    }
                }
                catch (Exception ex)
                {
                    MainPage.Log("Exception 1 : " + ex.Message);
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        waitPage.Hide();
                    });
                }
            });
        }
 
        /// <summary>
        /// 加载服务器选择按钮事件
        /// </summary>
        void LoadEvent_Server()
        {
            //判断之前是否选择过
            if (UserInfo.Current.GlobalRegion != null && !string.IsNullOrEmpty(UserInfo.Current.GlobalRegion.regionUrl))
            {
 
                SetServerText();
            }
 
            EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
            {
                Action selectAction = () =>
                {
                    //服务器选择过标记为true
                    SetServerText();
                };
                new SelectServerDialog(selectAction).LoadPage();
 
            };
 
            btnServerGo.MouseUpEventHandler = eventHandler;
            btnServerText.MouseUpEventHandler = eventHandler;
        }
 
        /// <summary>
        /// 检测是否选择了服务器
        /// </summary>
        /// <returns></returns>
        private bool CheckIfSelectServer()
        {
            if (isSelectServer == false)
            {
                //请先选择国家/区域
                Utlis.ShowTip(Language.StringByID(StringId.PleaseSelectCountryOrRegion));
                ShowServerBottomLineState(true);
                return false;
            }
            return true;
        }
 
        /// <summary>
        /// 服务器下划线样式
        /// </summary>
        /// <param name="isError"></param>
        void ShowServerBottomLineState(bool isError)
        {
            if (isError)
            {
                btnServerBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                btnServerBottomLine.Height = Application.GetRealHeight(2);
            }
            else
            {
                btnServerBottomLine.BackgroundColor = CSS_Color.DividingLineColor;
                btnServerBottomLine.Height = Application.GetRealHeight(1);
            }
        }
 
        /// <summary>
        /// 
        /// </summary>
        void SetServerText()
        {
            //服务器选择过标记为true
            isSelectServer = true;
            ShowServerBottomLineState(false);
            btnServerText.TextColor = CSS_Color.FirstLevelTitleColor;
            btnServerText.Text = UserInfo.Current.GlobalRegion.regionName;
        }
    }
}