using System; using System.Collections.Generic; namespace Shared.SimpleControl.Phone { public class DoorLockRecord : FrameLayout { DoorLock doorLock; FrameLayout searchView; VerticalScrolViewLayout middleVerticalScrolViewLayout; string noticeType; string Year; string Month; string Day; string inputUserId; string btnPasswordName; string btnProximityName; FrameLayout diplayTextView; public DoorLockRecord (DoorLock doorLock) { this.doorLock = doorLock; BackgroundColor = SkinStyle.Current.MainColor; } /// /// 读门锁所有历史记录信息 /// /// Door lock. void readStatus (DoorLock door_lock, int number) { System.Threading.Tasks.Task.Run (() => { Application.RunOnMainThread (() => { MainPage.Loading.Start ("Please wait..."); }); try { doorLock.stateAndAlarmList.Clear (); for (int i = 0, lostLink = 0; i < number; i++) { doorLock.stateAndAlarmList.Add (new DoorLockStateAndAlarmInfo ()); var stateAndAlarmInfoBytes = Control.ControlBytesSendHasReturn (Command.ReadDoorLockStateAndAlarm, door_lock.SubnetID, door_lock.DeviceID, new byte [] { door_lock.LoopID, (byte)i }); if (stateAndAlarmInfoBytes == null) { lostLink++; } else { lostLink = 0; var doorLockStateAndAlarmInfo = doorLock.stateAndAlarmList [i]; doorLockStateAndAlarmInfo.DoorLockType = stateAndAlarmInfoBytes [2]; doorLockStateAndAlarmInfo.UserID = stateAndAlarmInfoBytes [3]; doorLockStateAndAlarmInfo.DoorLockYear = stateAndAlarmInfoBytes [4].ToString (); doorLockStateAndAlarmInfo.DoorLockMonth = stateAndAlarmInfoBytes [5].ToString (); doorLockStateAndAlarmInfo.DoorLockDay = stateAndAlarmInfoBytes [6].ToString (); doorLockStateAndAlarmInfo.DoorLockHour = stateAndAlarmInfoBytes [7].ToString (); doorLockStateAndAlarmInfo.DoorLockMinute = stateAndAlarmInfoBytes [8].ToString (); doorLockStateAndAlarmInfo.DoorLockSec = stateAndAlarmInfoBytes [9].ToString (); } if (2 <= lostLink) { break; } } } catch { } finally { Application.RunOnMainThread (() => { MainPage.Loading.Hide (); middleVerticalScrolViewLayout.RemoveAll (); for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { showRecordList (doorLock.stateAndAlarmList [index]); } }); } }); } /// /// 界面布局 /// public void ShowUserHisroryRecord () { #region 标题 var topView = new FrameLayout () { Y = Application.GetRealHeight (36), Height = Application.GetRealHeight (90), }; AddChidren (topView); var title = new Button () { TextAlignment = TextAlignment.Center, TextID = R.MyInternationalizationString.UnlockRecord, TextSize = 19, TextColor = SkinStyle.Current.TextColor1, }; topView.AddChidren (title); var logo = new Button () { Width = Application.GetRealWidth (154), Height = Application.GetRealHeight (90), X = Application.GetRealWidth (486), UnSelectedImagePath = MainPage.LogoString, Gravity = Gravity.CenterVertical, }; topView.AddChidren (logo); var back = new Button () { Height = Application.GetRealHeight (90), Width = Application.GetRealWidth (85), UnSelectedImagePath = "Item/Back.png", SelectedImagePath = "Item/BackSelected.png", Gravity = Gravity.CenterVertical, }; topView.AddChidren (back); back.MouseUpEventHandler += (sender, e) => { this.RemoveFromParent (); }; #endregion #region search View searchView = new FrameLayout () { Height = Application.GetRealHeight (90), BackgroundColor = SkinStyle.Current.TitileView, Y = topView.Bottom, }; AddChidren (searchView); Button timeView = new Button () { Width = Application.GetRealWidth (212), TextID = R.MyInternationalizationString.Date, UnSelectedImagePath = "DoorLockPic/door_lock_user.png", SelectedImagePath = "DoorLockPic/door_lock_user_on.png", Padding = new Padding (0, 0, 0, 25), TextColor = SkinStyle.Current.TextColor1, }; searchView.AddChidren (timeView); Button btnTimeLine = new Button () { X = timeView.Right, Y = 1, Width = 1, Height = Application.GetRealHeight (90) - 2, BackgroundColor = SkinStyle.Current.White20Transparent, }; searchView.AddChidren (btnTimeLine); Button userView = new Button () { X = btnTimeLine.Right, Width = Application.GetRealWidth (212), TextID = R.MyInternationalizationString.DoorLockUser, UnSelectedImagePath = "DoorLockPic/door_lock_user.png", SelectedImagePath = "DoorLockPic/door_lock_user_on.png", Padding = new Padding (0, 0, 0, 25), TextColor = SkinStyle.Current.TextColor1, }; searchView.AddChidren (userView); Button btnUserLine = new Button () { X = userView.Right, Y = 1, Width = 1, Height = Application.GetRealHeight (90) - 2, BackgroundColor = SkinStyle.Current.White20Transparent, }; searchView.AddChidren (btnUserLine); Button typeView = new Button () { X = btnUserLine.Right, Width = Application.GetRealWidth (212), TextID = R.MyInternationalizationString.DoorLockSearch, UnSelectedImagePath = "DoorLockPic/door_lock_user.png", SelectedImagePath = "DoorLockPic/door_lock_user_on.png", Padding = new Padding (0, 0, 0, 25), TextColor = SkinStyle.Current.TextColor1, }; searchView.AddChidren (typeView); timeView.MouseUpEventHandler += (sender, e) => { TimeSearch (); }; userView.MouseUpEventHandler += (sender, e) => { iDSearch (sender, e); }; typeView.MouseUpEventHandler += (sender, e) => { typeSearch (); }; #endregion diplayTextView = new FrameLayout () { Height = 0, Y = searchView.Bottom, BackgroundColor = 0xff6a6a6a, }; AddChidren (diplayTextView); middleVerticalScrolViewLayout = new VerticalScrolViewLayout () { Height = Application.GetRealHeight (910 - 98), Y = searchView.Bottom, }; AddChidren (middleVerticalScrolViewLayout); #region bottomFrameLayout var bottomFrameLayout = new FrameLayout () { Height = Application.GetRealHeight (98), Y = Application.GetRealHeight (1136 - 100), BackgroundColor = SkinStyle.Current.TitileView }; AddChidren (bottomFrameLayout); Button refreshPasswordListBtn = new Button () { Height = Application.GetRealHeight (97), TextID = R.MyInternationalizationString.ReFresh, TextSize = 15, TextColor = SkinStyle.Current.TextColor1, }; bottomFrameLayout.AddChidren (refreshPasswordListBtn); refreshPasswordListBtn.MouseUpEventHandler += (sender, e) => { doorLock.stateAndAlarmList.Clear (); middleVerticalScrolViewLayout.RemoveAll (); diplayTextView.Height = 0; middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98); middleVerticalScrolViewLayout.Y = searchView.Bottom; readStatus (doorLock, 100); }; #endregion readStatus (doorLock, 10); } /// /// 历史记录列表信息界面 /// 通过索引搜索 /// void showRecordList (DoorLockStateAndAlarmInfo historyRecord) { if (null == historyRecord) { historyRecord = new DoorLockStateAndAlarmInfo (); } var rowLayout = new RowLayout () { Height = Application.GetRealHeight (110), }; middleVerticalScrolViewLayout.AddChidren (rowLayout); var btnIcon = new Button () { //Width = Application.GetRealHeight (13), //Height = Application.GetRealHeight (13), Width = Application.GetRealHeight (0), Height = Application.GetRealHeight (13), X = Application.GetRealWidth (40), UnSelectedImagePath = "Item/Point.png", SelectedImagePath = "Item/PointSelected.png", Gravity = Gravity.CenterVertical, }; rowLayout.AddChidren (btnIcon); var timeText = new Button () { X = Application.GetRealWidth (48), Width = Application.GetRealWidth (206), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, TextColor = SkinStyle.Current.TextColor1, }; rowLayout.AddChidren (timeText); if (historyRecord.DoorLockDay == null && historyRecord.DoorLockMinute == null) { timeText.Text = "00" + "/" + "00" + "/" + "00" + " " + "00" + ":" + "00"; } else { timeText.Text = historyRecord.DoorLockYear + "/" + historyRecord.DoorLockMonth + "/" + historyRecord.DoorLockDay + " " + historyRecord.DoorLockHour + ":" + historyRecord.DoorLockMinute; } var btnUserId = new Button () { Width = Application.GetRealWidth (46), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = timeText.Right + Application.GetRealWidth (10), TextSize = 14, TextColor = SkinStyle.Current.TextColor1, }; rowLayout.AddChidren (btnUserId); var btnUserText1 = new Button () { Width = Application.GetRealWidth (250), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = btnUserId.Right + Application.GetRealWidth (5), TextSize = 14, TextColor = SkinStyle.Current.TextColor1, }; rowLayout.AddChidren (btnUserText1); if (historyRecord.DoorLockType < 7) { noticeType = "通知"; } else { noticeType = "警报"; } var noticePic1 = new Button () { X = Application.GetRealWidth (562), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (71), Height = Application.GetRealHeight (71), SelectedImagePath = "DoorLockPic/door_lock_alarm.png", IsSelected = noticeType == "警报" ? true : false, Enable = false, }; rowLayout.AddChidren (noticePic1); if (historyRecord.DoorLockType == 1) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_fingerprint.png"; } else if (historyRecord.DoorLockType == 2) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_password.png"; } else if (historyRecord.DoorLockType == 3) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_proximity_card.png"; } else if (historyRecord.DoorLockType == 5) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_remote.png"; } //所有的ID var dictionarys = new System.Collections.Generic.Dictionary> (); foreach (var doorLockStateAndAlarmInfo in doorLock.stateAndAlarmList) { if (dictionarys.ContainsKey (doorLockStateAndAlarmInfo.UserID)) { dictionarys [doorLockStateAndAlarmInfo.UserID].Add (doorLockStateAndAlarmInfo); } else { dictionarys.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } var fingerpfintIDDictionary = new System.Collections.Generic.Dictionary> (); var passwordIDDictionary = new System.Collections.Generic.Dictionary> (); var tempPasswordIDDictionary = new System.Collections.Generic.Dictionary> (); var proximityCardIDDictionary = new System.Collections.Generic.Dictionary> (); foreach (var dictionary in dictionarys) { for (int i = 0; i < dictionary.Value.Count; i++) { var doorLockStateAndAlarmInfo = dictionary.Value [i]; if (doorLockStateAndAlarmInfo.DoorLockType == 1) { if (fingerpfintIDDictionary.ContainsKey (dictionary.Key)) { fingerpfintIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { fingerpfintIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } else if (doorLockStateAndAlarmInfo.DoorLockType == 2) { if (passwordIDDictionary.ContainsKey (dictionary.Key)) { passwordIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { passwordIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } else if (doorLockStateAndAlarmInfo.DoorLockType == 6) { if (tempPasswordIDDictionary.ContainsKey (dictionary.Key)) { tempPasswordIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { tempPasswordIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } else if (doorLockStateAndAlarmInfo.DoorLockType == 3) { if (proximityCardIDDictionary.ContainsKey (dictionary.Key)) { proximityCardIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { proximityCardIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } } } //foreach (var doorLockStateAndAlarmInfoDictionary in passwordIDDictionary) { // var matchPasswordId = doorLock.passwordList.Find ((obj) => { return obj.userPasswordID == doorLockStateAndAlarmInfoDictionary.Key; }); // if (matchPasswordId == null) { // matchPasswordId = new DoorLockPasswrodInfo { userPasswordID = doorLockStateAndAlarmInfoDictionary.Key, passwordRemark = "Unknown" }; // } // btnPasswordName = matchPasswordId.passwordRemark; //} //foreach (var doorLockStateAndAlarmInfoDictionary in proximityCardIDDictionary) { // var proximityCardId = doorLock.proximityCarList.Find ((obj) => { return obj.proximityCardID == doorLockStateAndAlarmInfoDictionary.Key; }); // if (proximityCardId == null) { // proximityCardId = new DoorLockProximityCardInfo { proximityCardID = doorLockStateAndAlarmInfoDictionary.Key, proximityCardRemark = "Unknown" }; // } // btnProximityName = proximityCardId.proximityCardRemark; //} if (historyRecord.DoorLockType == 1) { var matchFingerptintId = doorLock.fingerprintList.Find ((obj) => { return obj.userFingerprintID == historyRecord.UserID; }); if (matchFingerptintId != null) { btnUserText1.Text = matchFingerptintId.fingerprintRemark; btnUserId.Text = matchFingerptintId.userFingerprintID.ToString (); } } else if (historyRecord.DoorLockType == 2) { var matchPasswordId = doorLock.passwordList.Find ((obj) => { return obj.userPasswordID == historyRecord.UserID; }); if (matchPasswordId != null) { btnUserText1.Text = matchPasswordId.passwordRemark; btnUserId.Text = matchPasswordId.userPasswordID.ToString (); } } else if (historyRecord.DoorLockType == 3) { var proximityCardId = doorLock.proximityCarList.Find ((obj) => { return obj.proximityCardID == historyRecord.UserID; }); if (proximityCardId != null) { btnUserText1.Text = proximityCardId.proximityCardRemark; btnUserId.Text = proximityCardId.proximityCardID.ToString (); } } else if (historyRecord.DoorLockType == 4) { btnUserText1.TextID = R.MyInternationalizationString.KeyUnlock; btnUserId.Text = "00"; } else if (historyRecord.DoorLockType == 5) { btnUserText1.TextID = R.MyInternationalizationString.RemoteUnlock; btnUserId.Text = "00"; } else if (historyRecord.DoorLockType == 6) { btnUserText1.Text = "UnKnown"; } else if ((historyRecord.DoorLockType & 0xF0) == 0X10) { btnUserText1.TextID = R.MyInternationalizationString.PasswordUnlockErrorAlarm; btnUserId.Text = "00"; } else if ((historyRecord.DoorLockType & 0xF0) == 0x20) { btnUserText1.TextID = R.MyInternationalizationString.DoorUncloseAlarm; btnUserId.Text = "00"; } else if ((historyRecord.DoorLockType & 0xF0) == 0x30) { btnUserText1.TextID = R.MyInternationalizationString.HijackAlarm; btnUserId.Text = "00"; } else if ((historyRecord.DoorLockType & 0xF0) == 0x40) { btnUserText1.TextID = R.MyInternationalizationString.TamperResistantAlarm; btnUserId.Text = "00"; } else if ((historyRecord.DoorLockType & 0xF0) == 0x50) { btnUserText1.TextID = R.MyInternationalizationString.LowBatteryAlarm; btnUserId.Text = "00"; } else if ((historyRecord.DoorLockType & 0xF0) == 0x60) { btnUserText1.TextID = R.MyInternationalizationString.FingerprintErrorAlarm; btnUserId.Text = "00"; } else if ((historyRecord.DoorLockType & 0xF0) == 0x70) { btnUserText1.TextID = R.MyInternationalizationString.ProximityCardErrorAlarm; btnUserId.Text = "00"; } else { btnUserText1.Text = "UnKnown"; btnUserId.Text = "00"; } } /// /// 历史记录列表信息界面 /// 通过对象搜索 /// void showRecordTypeList (DoorLockStateAndAlarmInfo userType, Button btnRemark, Button btnID) { var frameRowLayout1 = new RowLayout () { Height = Application.GetRealHeight (110), }; middleVerticalScrolViewLayout.AddChidren (frameRowLayout1); var btnIcon = new Button () { Width = Application.GetRealHeight (0), Height = Application.GetRealHeight (13), X = Application.GetRealWidth (40), UnSelectedImagePath = "Item/Point.png", SelectedImagePath = "Item/PointSelected.png", Gravity = Gravity.CenterVertical, }; frameRowLayout1.AddChidren (btnIcon); var timeText = new Button () { X = Application.GetRealWidth (48), Width = Application.GetRealWidth (206), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, Text = userType.DoorLockYear + "/" + userType.DoorLockMonth + "/" + userType.DoorLockDay + " " + userType.DoorLockHour + ":" + userType.DoorLockMinute, TextColor = SkinStyle.Current.TextColor1, }; frameRowLayout1.AddChidren (timeText); var btnUserId = new Button () { Width = Application.GetRealWidth (46), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = timeText.Right + Application.GetRealWidth (10), TextSize = 14, TextColor = SkinStyle.Current.TextColor1, }; frameRowLayout1.AddChidren (btnUserId); var btnUserText1 = new Button () { Width = Application.GetRealWidth (250), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = btnUserId.Right + Application.GetRealWidth (5), TextSize = 14, TextColor = SkinStyle.Current.TextColor1, }; frameRowLayout1.AddChidren (btnUserText1); if (userType.DoorLockType == 1) { btnUserText1.Text = btnRemark.Text; btnUserId.Text = btnID.Text; } else if (userType.DoorLockType == 2) { btnUserText1.Text = btnRemark.Text; btnUserId.Text = btnID.Text; } else if (userType.DoorLockType == 3) { btnUserText1.Text = btnRemark.Text; btnUserId.Text = btnID.Text; } else if (userType.DoorLockType == 4) { btnUserText1.TextID = R.MyInternationalizationString.KeyUnlock; btnUserId.Text = "00"; } else if (userType.DoorLockType == 5) { btnUserText1.TextID = R.MyInternationalizationString.RemoteUnlock; btnUserId.Text = "00"; } else if (userType.DoorLockType == 6) { btnUserText1.Text = btnRemark.Text; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0X10) { btnUserText1.TextID = R.MyInternationalizationString.PasswordUnlockErrorAlarm; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0x20) { btnUserText1.TextID = R.MyInternationalizationString.DoorUncloseAlarm; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0x30) { btnUserText1.TextID = R.MyInternationalizationString.HijackAlarm; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0x40) { btnUserText1.TextID = R.MyInternationalizationString.TamperResistantAlarm; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0x50) { btnUserText1.TextID = R.MyInternationalizationString.LowBatteryAlarm; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0x60) { btnUserText1.TextID = R.MyInternationalizationString.FingerprintErrorAlarm; btnUserId.Text = "00"; } else if ((userType.DoorLockType & 0xF0) == 0x70) { btnUserText1.TextID = R.MyInternationalizationString.ProximityCardErrorAlarm; btnUserId.Text = "00"; }else { btnUserText1.Text = "UnKnown"; btnUserId.Text = "00"; } if (userType.DoorLockType < 7) { noticeType = "通知"; } else { noticeType = "警报"; } var noticePic1 = new Button () { X = Application.GetRealWidth (550), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (71), Height = Application.GetRealHeight (71), SelectedImagePath = "DoorLockPic/door_lock_alarm.png", IsSelected = noticeType == "警报" ? true : false, TextColor = SkinStyle.Current.TextColor1, Enable = false, }; frameRowLayout1.AddChidren (noticePic1); if (userType.DoorLockType == 1) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_fingerprint.png"; } else if (userType.DoorLockType == 2) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_password.png"; } else if (userType.DoorLockType == 3) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_proximity_card.png"; } else if (userType.DoorLockType == 5) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_remote.png"; } } /// /// 通知类型搜索 /// void typeSearch () { Dialog dialog = new Dialog (); FrameLayout dialogBodyView = new FrameLayout () { Width = Application.GetRealWidth (400), Height = Application.GetRealHeight (610), BackgroundColor = SkinStyle.Current.DialogColor, Radius = 5, BorderColor = SkinStyle.Current.Transparent, BorderWidth = 0, Gravity = Gravity.Center }; dialog.AddChidren (dialogBodyView); Button btnTitle = new Button () { Height = Application.GetRealHeight (80), BackgroundColor = SkinStyle.Current.DialogTitle, TextAlignment = TextAlignment.Center, TextID = R.MyInternationalizationString.DoorLockSearch, TextColor = SkinStyle.Current.DialogTextColor, }; dialogBodyView.AddChidren (btnTitle); FrameLayout bodyView = new FrameLayout () { Y = btnTitle.Bottom, Height = Application.GetRealHeight (610 - 90 - 80), }; dialogBodyView.AddChidren (bodyView); var btnFingerprintNotice = new Button () { Width = Application.GetRealWidth (260), Height = Application.GetRealHeight (70), BackgroundColor = SkinStyle.Current.ButtonColor, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextAlignment = TextAlignment.Center, Radius = 5, TextID = R.MyInternationalizationString.FingerprintRecord, Y = Application.GetRealHeight (25), X = Application.GetRealWidth (70), TextColor = SkinStyle.Current.TextColor1, }; bodyView.AddChidren (btnFingerprintNotice); var btnPasswordNotice = new Button () { Width = Application.GetRealWidth (260), Height = Application.GetRealHeight (70), BackgroundColor = SkinStyle.Current.ButtonColor, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextAlignment = TextAlignment.Center, Radius = 5, TextID = R.MyInternationalizationString.PasswordRecord, Y = btnFingerprintNotice.Bottom + Application.GetRealHeight (10), X = Application.GetRealWidth (70), TextColor = SkinStyle.Current.TextColor1, }; bodyView.AddChidren (btnPasswordNotice); var btnProximityNotice = new Button () { Width = Application.GetRealWidth (260), Height = Application.GetRealHeight (70), BackgroundColor = SkinStyle.Current.ButtonColor, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Radius = 5, TextID = R.MyInternationalizationString.ProximityRecord, Y = btnPasswordNotice.Bottom + Application.GetRealHeight (10), X = Application.GetRealWidth (70), }; bodyView.AddChidren (btnProximityNotice); var btnRemoteNotice = new Button () { Width = Application.GetRealWidth (260), Height = Application.GetRealHeight (70), BackgroundColor = SkinStyle.Current.ButtonColor, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Radius = 5, TextID = R.MyInternationalizationString.RemoteRecord, Y = btnProximityNotice.Bottom + Application.GetRealHeight (10), X = Application.GetRealWidth (70), }; bodyView.AddChidren (btnRemoteNotice); var btnAlarm = new Button () { Width = Application.GetRealWidth (260), Height = Application.GetRealHeight (70), BackgroundColor = SkinStyle.Current.ButtonColor, SelectedBackgroundColor = SkinStyle.Current.SelectedColor, TextAlignment = TextAlignment.Center, TextColor = SkinStyle.Current.TextColor1, Radius = 5, Y = btnRemoteNotice.Bottom + Application.GetRealHeight (10), X = Application.GetRealWidth (70), TextID = R.MyInternationalizationString.AlarmNotice, }; bodyView.AddChidren (btnAlarm); Button btnClose = new Button () { Height = Application.GetRealHeight (90), Y = Application.GetRealHeight (612 - 90), BackgroundColor = SkinStyle.Current.DialogTitle, TextID = R.MyInternationalizationString.Close, TextColor = SkinStyle.Current.DialogTextColor, }; dialogBodyView.AddChidren (btnClose); btnClose.MouseUpEventHandler += (sender, e) => { dialog.Close (); }; btnFingerprintNotice.MouseDownEventHandler += (sender1, e1) => { btnFingerprintNotice.IsSelected = !btnFingerprintNotice.IsSelected; btnFingerprintNotice.IsSelected = true; btnPasswordNotice.IsSelected = false; btnProximityNotice.IsSelected = false; btnRemoteNotice.IsSelected = false; btnAlarm.IsSelected = false; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.Type) + ":" + Language.StringByID (R.MyInternationalizationString.FingerprintRecord), }; diplayTextView.AddChidren (btnText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { if (doorLock.stateAndAlarmList [index].DoorLockType == 1) { showRecordList (doorLock.stateAndAlarmList [index]); } } dialog.Close (); }; btnFingerprintNotice.MouseUpEventHandler += (sender1, e1) => { btnFingerprintNotice.IsSelected = false; }; btnPasswordNotice.MouseDownEventHandler += (sender1, e1) => { btnPasswordNotice.IsSelected = !btnPasswordNotice.IsSelected; btnFingerprintNotice.IsSelected = false; btnPasswordNotice.IsSelected = true; btnProximityNotice.IsSelected = false; btnRemoteNotice.IsSelected = false; btnAlarm.IsSelected = false; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.Type) + ":" + Language.StringByID (R.MyInternationalizationString.PasswordRecord), }; diplayTextView.AddChidren (btnText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { if (doorLock.stateAndAlarmList [index].DoorLockType == 2) { showRecordList (doorLock.stateAndAlarmList [index]); } } dialog.Close (); }; btnPasswordNotice.MouseUpEventHandler += (sender1, e1) => { btnPasswordNotice.IsSelected = false; }; btnProximityNotice.MouseDownEventHandler += (sender1, e1) => { btnProximityNotice.IsSelected = !btnProximityNotice.IsSelected; btnFingerprintNotice.IsSelected = false; btnPasswordNotice.IsSelected = false; btnProximityNotice.IsSelected = true; btnRemoteNotice.IsSelected = false; btnAlarm.IsSelected = false; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.Type) + ":" + Language.StringByID (R.MyInternationalizationString.ProximityRecord), }; diplayTextView.AddChidren (btnText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { if (doorLock.stateAndAlarmList [index].DoorLockType == 3) { showRecordList (doorLock.stateAndAlarmList [index]); } } dialog.Close (); }; btnProximityNotice.MouseUpEventHandler += (sender1, e1) => { btnProximityNotice.IsSelected = false; }; btnRemoteNotice.MouseDownEventHandler += (sender1, e1) => { btnRemoteNotice.IsSelected = !btnRemoteNotice.IsSelected; btnFingerprintNotice.IsSelected = false; btnPasswordNotice.IsSelected = false; btnProximityNotice.IsSelected = false; btnRemoteNotice.IsSelected = true; btnAlarm.IsSelected = false; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.Type) + ":" + Language.StringByID (R.MyInternationalizationString.RemoteRecord), }; diplayTextView.AddChidren (btnText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { if (doorLock.stateAndAlarmList [index].DoorLockType == 5) { showRecordList (doorLock.stateAndAlarmList [index]); } } dialog.Close (); }; btnRemoteNotice.MouseUpEventHandler += (sender1, e1) => { btnRemoteNotice.IsSelected = false; }; btnAlarm.MouseDownEventHandler += (sender1, e1) => { btnAlarm.IsSelected = !btnAlarm.IsSelected; btnFingerprintNotice.IsSelected = false; btnPasswordNotice.IsSelected = false; btnProximityNotice.IsSelected = false; btnRemoteNotice.IsSelected = false; btnAlarm.IsSelected = true; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.Type) + ":" + Language.StringByID (R.MyInternationalizationString.AlarmNotice), }; diplayTextView.AddChidren (btnText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { if (6 < doorLock.stateAndAlarmList [index].DoorLockType) { showRecordList (doorLock.stateAndAlarmList [index]); } } dialog.Close (); }; btnAlarm.MouseUpEventHandler += (sender1, e1) => { btnAlarm.IsSelected = false; }; middleVerticalScrolViewLayout.MouseUpEventHandler += (sender2, e2) => { dialog.Close (); }; dialog.Show (); } /// /// 按日期搜索 /// void TimeSearch () { Dialog dialog = new Dialog (); FrameLayout bodyView = new FrameLayout () { Gravity = Gravity.Center, Width = Application.GetRealWidth (500), Height = Application.GetRealHeight (600), BackgroundColor = SkinStyle.Current.DialogColor, Radius = 5, BorderWidth = 1, BorderColor = SkinStyle.Current.Transparent, }; dialog.AddChidren (bodyView); var dateView = new DateView () { Height = Application.GetRealHeight (520), }; bodyView.AddChidren (dateView); FrameLayout bottomView = new FrameLayout () { Y = dateView.Bottom, Height = Application.GetRealHeight (82), BackgroundColor = SkinStyle.Current.DialogTitle }; bodyView.AddChidren (bottomView); Button btnColse = new Button () { Width = Application.GetRealWidth (250), TextID = R.MyInternationalizationString.cancel, BackgroundColor = SkinStyle.Current.ButtonColor, TextColor = SkinStyle.Current.TextColor1, }; bottomView.AddChidren (btnColse); btnColse.MouseUpEventHandler += (sender, e) => { dialog.Close (); }; Button btnBottomLine = new Button () { X = btnColse.Right, Width = 1, BackgroundColor = SkinStyle.Current.LineColor, }; bottomView.AddChidren (btnBottomLine); Button btnSave = new Button () { X = btnBottomLine.Right, Width = Application.GetRealWidth (250), BackgroundColor = SkinStyle.Current.ButtonColor, TextColor = SkinStyle.Current.TextColor1, TextID = R.MyInternationalizationString.confirm }; bottomView.AddChidren (btnSave); btnSave.MouseUpEventHandler += (sender2, e2) => { middleVerticalScrolViewLayout.RemoveAll (); Year = (dateView.Year - 2000).ToString ();//if (Application.DeviceType == Device.Ios) { if (Application.DeviceType == Device.Ios) { Month = dateView.Month.ToString (); } else { Month = (dateView.Month + 1).ToString (); } Day = dateView.Day.ToString (); diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnUserIDText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), //Text = R.MyInternationalizationString.Date + ":" + Year.ToString () + "." + Month.ToString () + "." + Day.ToString (), Text = Language.StringByID (R.MyInternationalizationString.Date) + ":" + Year.ToString () + "." + Month.ToString () + "." + Day.ToString (), }; diplayTextView.AddChidren (btnUserIDText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; for (int index = 0; index < doorLock.stateAndAlarmList.Count; index++) { if (doorLock.stateAndAlarmList [index].DoorLockYear == Year.ToString ()) { if (doorLock.stateAndAlarmList [index].DoorLockMonth == Month.ToString ()) { if (doorLock.stateAndAlarmList [index].DoorLockDay == Day.ToString ()) { var frameRowLayout = new RowLayout () { Height = Application.GetRealHeight (110), }; middleVerticalScrolViewLayout.AddChidren (frameRowLayout); var btnIcon = new Button () { Width = Application.GetRealHeight (0), Height = Application.GetRealHeight (13), X = Application.GetRealWidth (40), UnSelectedImagePath = "Item/Point.png", SelectedImagePath = "Item/PointSelected.png", Gravity = Gravity.CenterVertical, }; frameRowLayout.AddChidren (btnIcon); var timeText = new Button () { X = Application.GetRealWidth (48), Width = Application.GetRealWidth (150), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, Text = doorLock.stateAndAlarmList [index].DoorLockHour + ":" + doorLock.stateAndAlarmList [index].DoorLockMinute, }; frameRowLayout.AddChidren (timeText); var btnUserId = new Button () { Width = Application.GetRealWidth (46), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (215), TextSize = 14, }; frameRowLayout.AddChidren (btnUserId); var btnUserText1 = new Button () { Width = Application.GetRealWidth (275), Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = btnUserId.Right + Application.GetRealWidth (11), TextSize = 14, }; frameRowLayout.AddChidren (btnUserText1); //所有的ID var dictionarys = new System.Collections.Generic.Dictionary> (); foreach (var doorLockStateAndAlarmInfo in doorLock.stateAndAlarmList) { if (dictionarys.ContainsKey (doorLockStateAndAlarmInfo.UserID)) { dictionarys [doorLockStateAndAlarmInfo.UserID].Add (doorLockStateAndAlarmInfo); } else { dictionarys.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } // var fingerpfintIDDictionary = new System.Collections.Generic.Dictionary> (); // var passwordIDDictionary = new System.Collections.Generic.Dictionary> (); // var tempPasswordIDDictionary = new System.Collections.Generic.Dictionary> (); // var proximityCardIDDictionary = new System.Collections.Generic.Dictionary> (); foreach (var dictionary in dictionarys) { for (int i = 0; i < dictionary.Value.Count; i++) { var doorLockStateAndAlarmInfo = dictionary.Value [i]; //if (doorLockStateAndAlarmInfo.DoorLockType == 1) { // if (fingerpfintIDDictionary.ContainsKey (dictionary.Key)) { // fingerpfintIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); // } else { // fingerpfintIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); // } //} else if (doorLockStateAndAlarmInfo.DoorLockType == 2) { // if (passwordIDDictionary.ContainsKey (dictionary.Key)) { // passwordIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); // } else { // passwordIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); // } //} else if (doorLockStateAndAlarmInfo.DoorLockType == 6) { // if (tempPasswordIDDictionary.ContainsKey (dictionary.Key)) { // tempPasswordIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); // } else { // tempPasswordIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); // } //} else if (doorLockStateAndAlarmInfo.DoorLockType == 3) { // if (proximityCardIDDictionary.ContainsKey (dictionary.Key)) { // proximityCardIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); // } else { // proximityCardIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); // } //} } } //foreach (var doorLockStateAndAlarmInfoDictionary in passwordIDDictionary) { // var matchPasswordId = doorLock.passwordList.Find ((obj) => { return obj.userPasswordID == doorLockStateAndAlarmInfoDictionary.Key; }); // if (matchPasswordId == null) { // matchPasswordId = new DoorLockPasswrodInfo { userPasswordID = doorLockStateAndAlarmInfoDictionary.Key, passwordRemark = "Unknown" }; // } // btnPasswordName = matchPasswordId.passwordRemark; //} //foreach (var doorLockStateAndAlarmInfoDictionary in proximityCardIDDictionary) { // var proximityCardId = doorLock.proximityCarList.Find ((obj) => { return obj.proximityCardID == doorLockStateAndAlarmInfoDictionary.Key; }); // if (proximityCardId == null) { // proximityCardId = new DoorLockProximityCardInfo { proximityCardID = doorLockStateAndAlarmInfoDictionary.Key, proximityCardRemark = "Unknown" }; // } // btnProximityName = proximityCardId.proximityCardRemark; //} if (doorLock.stateAndAlarmList [index].DoorLockType == 1) { var matchFingerptintId = doorLock.fingerprintList.Find ((obj) => { return obj.userFingerprintID == doorLock.stateAndAlarmList [index].UserID; }); if (matchFingerptintId != null) { btnUserId.Text = matchFingerptintId.userFingerprintID.ToString (); btnUserText1.Text = matchFingerptintId.fingerprintRemark; } } else if (doorLock.stateAndAlarmList [index].DoorLockType == 2) { var matchPasswordId = doorLock.passwordList.Find ((obj) => { return obj.userPasswordID == doorLock.stateAndAlarmList [index].UserID; }); if (matchPasswordId != null) { btnUserId.Text = matchPasswordId.userPasswordID.ToString (); btnUserText1.Text = matchPasswordId.passwordRemark; } } else if (doorLock.stateAndAlarmList [index].DoorLockType == 3) { var proximityCardId = doorLock.proximityCarList.Find ((obj) => { return obj.proximityCardID == doorLock.stateAndAlarmList [index].UserID; }); if (proximityCardId != null) { btnUserId.Text = proximityCardId.proximityCardID.ToString (); btnUserText1.Text = proximityCardId.proximityCardRemark; } } else if (doorLock.stateAndAlarmList [index].DoorLockType == 4) { btnUserText1.TextID = R.MyInternationalizationString.KeyUnlock; btnUserId.Text = "00"; } else if (doorLock.stateAndAlarmList [index].DoorLockType == 5) { btnUserText1.TextID = R.MyInternationalizationString.RemoteUnlock; btnUserId.Text = "00"; } else if (doorLock.stateAndAlarmList [index].DoorLockType == 6) { btnUserText1.Text = "UnKnown"; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0X10) { btnUserText1.TextID = R.MyInternationalizationString.PasswordUnlockErrorAlarm; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0x20) { btnUserText1.TextID = R.MyInternationalizationString.DoorUncloseAlarm; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0x30) { btnUserText1.TextID = R.MyInternationalizationString.HijackAlarm; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0x40) { btnUserText1.TextID = R.MyInternationalizationString.TamperResistantAlarm; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0x50) { btnUserText1.TextID = R.MyInternationalizationString.LowBatteryAlarm; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0x60) { btnUserText1.TextID = R.MyInternationalizationString.FingerprintErrorAlarm; btnUserId.Text = "00"; } else if ((doorLock.stateAndAlarmList [index].DoorLockType & 0xF0) == 0x70) { btnUserText1.TextID = R.MyInternationalizationString.ProximityCardErrorAlarm; btnUserId.Text = "00"; } else { btnUserText1.Text = "UnKnown"; btnUserId.Text = "00"; } if (doorLock.stateAndAlarmList [index].DoorLockType < 8) { noticeType = "通知"; } else { noticeType = "警报"; } var noticePic1 = new Button () { X = Application.GetRealWidth (550), Gravity = Gravity.CenterVertical, Width = Application.GetRealWidth (71), Height = Application.GetRealHeight (71), SelectedImagePath = "DoorLockPic/door_lock_alarm.png", IsSelected = noticeType == "警报" ? true : false, Enable = false, }; frameRowLayout.AddChidren (noticePic1); if (doorLock.stateAndAlarmList [index].DoorLockType == 1) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_fingerprint.png"; } else if (doorLock.stateAndAlarmList [index].DoorLockType == 2) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_password.png"; } else if (doorLock.stateAndAlarmList [index].DoorLockType == 3) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_proximity_card.png"; } else if (doorLock.stateAndAlarmList [index].DoorLockType == 5) { noticePic1.UnSelectedImagePath = "DoorLockPic/door_lock_remote.png"; } } } } } dialog.Close (); }; middleVerticalScrolViewLayout.MouseUpEventHandler += (sender1, e1) => { dialog.Close (); }; dialog.Show (); } /// /// 按用户搜索 /// void iDSearch (object sender, System.EventArgs e) { //所有的ID var dictionarys = new System.Collections.Generic.Dictionary> (); foreach (var doorLockStateAndAlarmInfo in doorLock.stateAndAlarmList) { if (dictionarys.ContainsKey (doorLockStateAndAlarmInfo.UserID)) { dictionarys [doorLockStateAndAlarmInfo.UserID].Add (doorLockStateAndAlarmInfo); } else { dictionarys.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } var fingerpfintIDDictionary = new System.Collections.Generic.Dictionary> (); var passwordIDDictionary = new System.Collections.Generic.Dictionary> (); var tempPasswordIDDictionary = new System.Collections.Generic.Dictionary> (); var proximityCardIDDictionary = new System.Collections.Generic.Dictionary> (); foreach (var dictionary in dictionarys) { for (int i = 0; i < dictionary.Value.Count; i++) { var doorLockStateAndAlarmInfo = dictionary.Value [i]; if (doorLockStateAndAlarmInfo.DoorLockType == 1) { if (fingerpfintIDDictionary.ContainsKey (dictionary.Key)) { fingerpfintIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { fingerpfintIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } else if (doorLockStateAndAlarmInfo.DoorLockType == 2) { if (passwordIDDictionary.ContainsKey (dictionary.Key)) { passwordIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { passwordIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } else if (doorLockStateAndAlarmInfo.DoorLockType == 6) { if (tempPasswordIDDictionary.ContainsKey (dictionary.Key)) { tempPasswordIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { tempPasswordIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } else if (doorLockStateAndAlarmInfo.DoorLockType == 3) { if (proximityCardIDDictionary.ContainsKey (dictionary.Key)) { proximityCardIDDictionary [dictionary.Key].Add (doorLockStateAndAlarmInfo); } else { proximityCardIDDictionary.Add (doorLockStateAndAlarmInfo.UserID, new List (new [] { doorLockStateAndAlarmInfo })); } } } } var dialog = new Dialog (); FrameLayout dialogBodyView = new FrameLayout () { Gravity = Gravity.Center, Width = Application.GetRealWidth (420), Height = Application.GetRealHeight (480), BackgroundColor = SkinStyle.Current.DialogColor, Radius = 5, BorderWidth = 1, BorderColor = SkinStyle.Current.Transparent, }; dialog.AddChidren (dialogBodyView); var titleID = new Button () { Width = Application.GetRealWidth (420), Height = Application.GetRealHeight (80), TextID = R.MyInternationalizationString.UserIDName, BackgroundColor = SkinStyle.Current.DialogTitle, TextAlignment = TextAlignment.Center, }; dialogBodyView.AddChidren (titleID); var bodyView = new VerticalScrolViewLayout () { Width = Application.GetRealWidth (425), Height = Application.GetRealHeight (325), Y = titleID.Bottom, }; dialogBodyView.AddChidren (bodyView); //指纹 foreach (var doorLockStateAndAlarmInfoDictionary in fingerpfintIDDictionary) { var matchFingerptintId = doorLock.fingerprintList.Find ((obj) => { return obj.userFingerprintID == doorLockStateAndAlarmInfoDictionary.Key; }); if (matchFingerptintId == null) { matchFingerptintId = new DoorLockFingerprintInfo { userFingerprintID = doorLockStateAndAlarmInfoDictionary.Key, fingerprintRemark = "Unknown" }; } var remarkView = new RowLayout () { Height = Application.GetRealHeight (90), Width = Application.GetRealWidth (420), BackgroundColor = SkinStyle.Current.DialogColor, }; bodyView.AddChidren (remarkView); var btnID = new Button () { Width = Application.GetRealWidth (0), Height = Application.GetRealHeight (0), Gravity = Gravity.CenterVertical, Text = matchFingerptintId.userFingerprintID.ToString (), TextColor = SkinStyle.Current.TextColor1, }; remarkView.AddChidren (btnID); var btnRemark = new Button () { X = btnID.Right + Application.GetRealWidth (4), TextAlignment = TextAlignment.Center, Text = matchFingerptintId.fingerprintRemark, TextColor = SkinStyle.Current.TextColor, }; remarkView.AddChidren (btnRemark); btnRemark.MouseUpEventHandler += (sender2, e2) => { inputUserId = btnRemark.Text; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnUserIDText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.DoorLockUserType) + ":" + inputUserId, }; diplayTextView.AddChidren (btnUserIDText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; foreach (var userIDType in doorLockStateAndAlarmInfoDictionary.Value) { showRecordTypeList (userIDType, btnRemark, btnID); } dialog.Close (); }; } //密码 foreach (var doorLockStateAndAlarmInfoDictionary in passwordIDDictionary) { var matchPasswordId = doorLock.passwordList.Find ((obj) => { return obj.userPasswordID == doorLockStateAndAlarmInfoDictionary.Key; }); if (matchPasswordId == null) { matchPasswordId = new DoorLockPasswrodInfo { userPasswordID = doorLockStateAndAlarmInfoDictionary.Key, passwordRemark = "Unknown" }; } var remarkView = new RowLayout () { Height = Application.GetRealHeight (110), Width = Application.GetRealWidth (420), BackgroundColor = SkinStyle.Current.DialogColor, }; bodyView.AddChidren (remarkView); var btnID = new Button () { Width = Application.GetRealWidth (0), Height = Application.GetRealHeight (0), Gravity = Gravity.CenterVertical, Text = matchPasswordId.userPasswordID.ToString (), }; remarkView.AddChidren (btnID); var btnRemark = new Button () { X = btnID.Right + Application.GetRealWidth (4), TextAlignment = TextAlignment.Center, Text = matchPasswordId.passwordRemark, TextColor = SkinStyle.Current.TextColor, }; remarkView.AddChidren (btnRemark); btnRemark.MouseUpEventHandler += (sender2, e2) => { inputUserId = btnRemark.Text; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnUserIDText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.DoorLockUserType) + ":" + inputUserId, }; diplayTextView.AddChidren (btnUserIDText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; foreach (var userIDType in doorLockStateAndAlarmInfoDictionary.Value) { showRecordTypeList (userIDType, btnRemark, btnID); } dialog.Close (); }; } //感应卡 foreach (var doorLockStateAndAlarmInfoDictionary in proximityCardIDDictionary) { var proximityCardId = doorLock.proximityCarList.Find ((obj) => { return obj.proximityCardID == doorLockStateAndAlarmInfoDictionary.Key; }); if (proximityCardId == null) { proximityCardId = new DoorLockProximityCardInfo { proximityCardID = doorLockStateAndAlarmInfoDictionary.Key, proximityCardRemark = "Unknown" }; } var remarkView = new RowLayout () { Height = Application.GetRealHeight (110), Width = Application.GetRealWidth (420), BackgroundColor = SkinStyle.Current.DialogColor, }; bodyView.AddChidren (remarkView); var btnID = new Button () { Width = Application.GetRealWidth (0), Height = Application.GetRealHeight (0), Gravity = Gravity.CenterVertical, Text = proximityCardId.proximityCardID.ToString (), }; remarkView.AddChidren (btnID); var btnRemark = new Button () { X = btnID.Right + Application.GetRealWidth (4), TextAlignment = TextAlignment.Center, Text = proximityCardId.proximityCardRemark, TextColor = SkinStyle.Current.TextColor, }; remarkView.AddChidren (btnRemark); btnRemark.MouseUpEventHandler += (sender2, e2) => { inputUserId = btnRemark.Text; diplayTextView.RemoveAll (); diplayTextView.Height = Application.GetRealWidth (80); var btnUserIDText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language.StringByID (R.MyInternationalizationString.DoorLockUserType) + ":" + inputUserId, }; diplayTextView.AddChidren (btnUserIDText); middleVerticalScrolViewLayout.RemoveAll (); middleVerticalScrolViewLayout.Height = Application.GetRealHeight (910 - 98 - 80); middleVerticalScrolViewLayout.Y = diplayTextView.Bottom; foreach (var userIDType in doorLockStateAndAlarmInfoDictionary.Value) { showRecordTypeList (userIDType, btnRemark, btnID); } dialog.Close (); }; } /* //临时密码 foreach (var doorLockStateAndAlarmInfoDictionary in tempPasswordIDDictionary) { if (doorLockStateAndAlarmInfoDictionary.Key == 10) { var remarkView = new RowLayout () { Height = Application.GetRealHeight (110), Width = Application.GetRealWidth (420), BackgroundColor = 0xF02E2E2E, }; bodyView.AddChidren (remarkView); var btnRemark = new Button () { Text = doorLock.tempPasswordRemark, X = Application.GetRealWidth (20), TextAlignment = TextAlignment.Center, }; remarkView.AddChidren (btnRemark); btnRemark.MouseUpEventHandler += (sender2, e2) => { inputUserId = btnRemark.Text; var btnUserIDFrameLayout = new FrameLayout () { Height = Application.GetRealHeight (80), Y = frameLayout.Bottom, BackgroundColor = SkinStyle.Current.SubtitleView, }; mainFrameLayout.AddChidren (btnUserIDFrameLayout); var btnUserIDText = new Button () { Height = LayoutParams.MatchParent, TextAlignment = TextAlignment.CenterLeft, X = Application.GetRealWidth (40), Text = Language .StringByID(R.MyInternationalizationString .User) + ":" + inputUserId, }; btnUserIDFrameLayout.AddChidren (btnUserIDText); var middleVerticalScrolViewLayout = new VerticalScrolViewLayout () { Width = LayoutParams.MatchParent, Height = Application.GetRealHeight (910 - 98 - 80), Y = btnUserIDFrameLayout.Bottom, }; mainFrameLayout.AddChidren (middleVerticalScrolViewLayout); foreach (var userIDType in doorLockStateAndAlarmInfoDictionary.Value) { frameRowLayout1 = new RowLayout () { Height = Application.GetRealHeight (110), }; middleVerticalScrolViewLayout.AddChidren (frameRowLayout1); showRecordTypeList (userIDType); } dialog.Close (); }; } } */ var btnClose = new Button () { Width = Application.GetRealWidth (420), Height = Application.GetRealHeight (82), BackgroundColor = SkinStyle.Current.DialogTitle, TextID = R.MyInternationalizationString.Close, Y = Application.GetRealHeight (400), TextColor = SkinStyle.Current.DialogTextColor, }; dialogBodyView.AddChidren (btnClose); btnClose.MouseUpEventHandler += (sender1, e1) => { dialog.Close (); }; dialog.Show (); } } }