wxr
2020-04-21 f718d23a262a5a8e1241fdeaeb4153399f95e79d
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
using System;
using Shared;
 
namespace HDL_ON.UI
{
    public partial class AppUnlockSettingsPage
    {
        void LoadEventList()
        {
            LoadEvent_OptionChange();
            LoadEvent_InitOptionState();
        }
 
        /// <summary>
        /// 加载密码选项事件
        /// </summary>
        void LoadEvent_OptionChange()
        {
            EventHandler< MouseEventArgs> eventHandler1 = (sender, e) => {
                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
                btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = false;
                btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = false;
                btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = false;
 
                btnTipMsg.TextID = StringId.UnprotectedTipMsg;
                btnTipMsg.Visible = true;
 
                MainPage.LoginUser.appUnlock = new System.Collections.Generic.List<string>();
                MainPage.LoginUser.SaveUserInfo();
 
            };
            btnUnprotectedBg.MouseUpEventHandler = eventHandler1;
            btnUnprotectedSelectionIcon.MouseUpEventHandler = eventHandler1;
            btnUnprotectedSelectionTip.MouseUpEventHandler = eventHandler1;
 
 
            EventHandler<MouseEventArgs> eventHandler2 = (sender, e) => {
                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
                btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true;
 
                btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg);
                btnTipMsg.Visible = true;
 
                if (!MainPage.LoginUser.appUnlock.Contains("1"))
                {
                    MainPage.LoginUser.appUnlock.Add("1");
                    MainPage.LoginUser.SaveUserInfo();
                }
 
            };
            btnStartupBg.MouseUpEventHandler = eventHandler2;
            btnStartupSelectionIcon.MouseUpEventHandler = eventHandler2;
            btnStartupSelectionTip.MouseUpEventHandler = eventHandler2;
 
 
            EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => {
                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
                btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true;
 
                btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg);
                btnTipMsg.Visible = true;
 
                if (!MainPage.LoginUser.appUnlock.Contains("2"))
                {
                    MainPage.LoginUser.appUnlock.Add("2");
                    MainPage.LoginUser.SaveUserInfo();
                }
 
            };
            btnSecurityBg.MouseUpEventHandler = eventHandler3;
            btnSecuritySelectionIcon.MouseUpEventHandler = eventHandler3;
            btnSecuritySelectionTip.MouseUpEventHandler = eventHandler3;
 
 
            EventHandler<MouseEventArgs> eventHandler4 = (sender, e) => {
                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = false;
                btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true;
 
                btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg);
                btnTipMsg.Visible = true;
 
                if (!MainPage.LoginUser.appUnlock.Contains("3"))
                {
                    MainPage.LoginUser.appUnlock.Add("3");
                    MainPage.LoginUser.SaveUserInfo();
                }
 
            };
            btnDoorlockBg.MouseUpEventHandler = eventHandler4;
            btnDoorlockSelectionIcon.MouseUpEventHandler = eventHandler4;
            btnDoorlockSelectionTip.MouseUpEventHandler = eventHandler4;
 
 
 
        }
 
        /// <summary>
        /// 加载用户密码选项状态
        /// </summary>
        void LoadEvent_InitOptionState()
        {
            if (MainPage.LoginUser.appUnlock.Count == 0)
            {
                btnUnprotectedBg.IsSelected = btnUnprotectedSelectionIcon.IsSelected = btnUnprotectedSelectionTip.IsSelected = true;
            }
            else
            {
                if (MainPage.LoginUser.appUnlock.Contains("1"))
                {
                    btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = true;
                }
                if (MainPage.LoginUser.appUnlock.Contains("2"))
                {
                    btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = true;
                }
                if (MainPage.LoginUser.appUnlock.Contains("3"))
                {
                    btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = true;
                }
            }
        }
 
        /// <summary>
        /// 密码设置跳转事件列表
        /// </summary>
        void LoadEvet_SkipEventList()
        {
            btnPasswordUnlockTitle.MouseUpEventHandler = (sender, e) =>
            {
                var page = new AppUnlockPasswordSettingPage(MainPage.LoginUser.appUnlockPasswrod);
                MainPage.BasePageView.AddChidren(page);
                page.LoadPage();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
        }
    }
}