| | |
| | | EventHandler<MouseEventArgs> eventHandler2 = (sender, e) => |
| | | { |
| | | bool result = !btnStartupBg.IsSelected; |
| | | if (!result) |
| | | { |
| | | //如果启动解锁 不能取消启动解锁 |
| | | if (!CheckIfCanDeselect("1")) return; |
| | | } |
| | | btnStartupBg.IsSelected = btnStartupSelectionIcon.IsSelected = btnStartupSelectionTip.IsSelected = result; |
| | | |
| | | btnTipMsg.Text = Language.StringByID(StringId.AtStartupTipMsg); |
| | |
| | | EventHandler<MouseEventArgs> eventHandler3 = (sender, e) => |
| | | { |
| | | bool result = !btnSecurityBg.IsSelected; |
| | | if (!result) |
| | | { |
| | | //如果只剩布防/撤防一种 不能取消布防/撤防 |
| | | if (!CheckIfCanDeselect("2")) return; |
| | | } |
| | | |
| | | btnSecurityBg.IsSelected = btnSecuritySelectionIcon.IsSelected = btnSecuritySelectionTip.IsSelected = result; |
| | | |
| | | btnTipMsg.Text = Language.StringByID(StringId.DefenseAndUndefenseTipMsg); |
| | |
| | | EventHandler<MouseEventArgs> eventHandler4 = (sender, e) => |
| | | { |
| | | bool result = !btnDoorlockBg.IsSelected; |
| | | if (!result) |
| | | { |
| | | //如果只剩远程开锁不能取消远程开锁 |
| | | if (!CheckIfCanDeselect("3")) return; |
| | | } |
| | | |
| | | btnDoorlockBg.IsSelected = btnDoorlockSelectionIcon.IsSelected = btnDoorlockSelectionTip.IsSelected = result; |
| | | |
| | | btnTipMsg.Text = Language.StringByID(StringId.RemoteUnlockingTipMsg); |
| | |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 判断是否能够取消,如果只剩最后一种解锁方案禁止取消 |
| | | /// </summary> |
| | | /// <param name="appUnlockPageType">1:启动时 2:布防撤防时 3:远程开锁时</param> |
| | | /// <returns></returns> |
| | | bool CheckIfCanDeselect(string appUnlockPageType) |
| | | { |
| | | if (UserInfo.Current.appUnlockPage.Count == 1 && UserInfo.Current.appUnlockPage.Contains(appUnlockPageType)) |
| | | { |
| | | return false; |
| | | } |
| | | |
| | | return true; |
| | | } |
| | | |
| | | } |
| | | } |