| | |
| | | /// </summary>
|
| | | private VerticalFrameRefreshControl listView = null;
|
| | | /// <summary>
|
| | | /// 全部的行
|
| | | /// 全部的行,主键是自动递增的东西
|
| | | /// </summary>
|
| | | private Dictionary<string, RowLayoutControl> dicAllRow = null;
|
| | |
|
| | |
| | |
|
| | | for (int i = 0; i < listData.Count; i++)
|
| | | {
|
| | | //添加信息行
|
| | | this.AddMsgRowControl(framBack, listData[i], i != listData.Count - 1);
|
| | | //一条信息里面,它可能包含多个报警
|
| | | for (int j = 0; j < listData[i].listMsg.Count; j++)
|
| | | {
|
| | | //设置已读的初始值
|
| | | listData[i].ListReading.Add(listData[i].IsReading);
|
| | | //添加信息行
|
| | | bool addLine = i != listData.Count - 1 || j != listData[i].listMsg.Count - 1;
|
| | | this.AddMsgRowControl(framBack, listData[i], j, addLine);
|
| | | }
|
| | | }
|
| | | //调整高度
|
| | | listView.AdjustChidrenFrameHeight(framBack, Application.GetRealHeight(23));
|
| | |
| | | /// </summary>
|
| | | /// <param name="frameList"></param>
|
| | | /// <param name="recordInfo"></param>
|
| | | /// <param name="msgIndex">报警消息的下标</param>
|
| | | /// <param name="addLine"></param>
|
| | | private void AddMsgRowControl(FrameListControl frameList, MessageRecordInfo recordInfo, bool addLine)
|
| | | private void AddMsgRowControl(FrameListControl frameList, MessageRecordInfo recordInfo, int msgIndex, bool addLine)
|
| | | {
|
| | | var rowControl = new RowLayoutControl(frameList.rowSpace / 2);
|
| | | frameList.AddChidren(rowControl);
|
| | |
| | | var btnMsgObject = rowControl.frameTable.AddLeftCaption(recordInfo.MsgObjectText, 600);
|
| | |
|
| | | //消息
|
| | | var btnMsg = rowControl.frameTable.AddMostRightView(recordInfo.MsgText, 600, 60);
|
| | | var btnMsg = rowControl.frameTable.AddMostRightView(recordInfo.listMsg[msgIndex], 600, 60);
|
| | | btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
|
| | | btnMsg.Y = Application.GetRealHeight(5) + rowControl.frameTable.chidrenYaxis;
|
| | | rowControl.frameTable.AddChidren(btnMsg, ChidrenBindMode.BindEventOnly);
|
| | |
| | | //底线
|
| | | if (addLine == true)
|
| | | {
|
| | | rowControl.frameTable.AddBottomLine(); |
| | | rowControl.frameTable.AddBottomLine();
|
| | | }
|
| | | //已读
|
| | | if (recordInfo.IsReading == true)
|
| | | if (recordInfo.ListReading[msgIndex] == true)
|
| | | {
|
| | | rowControl.frameTable.UseClickStatu = false;
|
| | | //消息类型
|
| | |
| | |
|
| | | //新消息
|
| | | PicViewControl btnNewTip = null;
|
| | | if (recordInfo.IsReading == false)
|
| | | if (recordInfo.ListReading[msgIndex] == false)
|
| | | {
|
| | | btnNewTip = new PicViewControl(78, 55);
|
| | | btnNewTip.UnSelectedImagePath = "Item/NewVersion.png";
|
| | |
| | | //点击
|
| | | rowControl.frameTable.ButtonClickEvent += async (sender, e) =>
|
| | | {
|
| | | if (recordInfo.IsReading == true)
|
| | | if (recordInfo.ListReading[msgIndex] == true)
|
| | | {
|
| | | return;
|
| | | }
|
| | | recordInfo.IsReading = true;
|
| | | recordInfo.ListReading[msgIndex] = true;
|
| | | rowControl.frameTable.UseClickStatu = false;
|
| | | //消息类型
|
| | | btnMsgObject.TextColor = UserCenterColor.Current.TextGrayColor1;
|
| | |
| | | if (info == null)
|
| | | {
|
| | | //非在册的消息记录
|
| | | recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered);
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered));
|
| | | return true;
|
| | | }
|
| | | else if (info.BatteryMsg != null)
|
| | |
|
| | | if (string.IsNullOrEmpty(info.AlarmMsg) == false)
|
| | | {
|
| | | recordInfo.MsgText = info.BatteryMsg;
|
| | | recordInfo.listMsg.Add(info.AlarmMsg);
|
| | | }
|
| | | else if (info.DemolishmenMsg != null)
|
| | | if (info.BatteryMsg != null)
|
| | | {
|
| | | recordInfo.MsgText = info.DemolishmenMsg;
|
| | | recordInfo.listMsg.Add(info.BatteryMsg);
|
| | | }
|
| | | else
|
| | | if (info.DemolishmenMsg != null)
|
| | | {
|
| | | recordInfo.MsgText = string.IsNullOrEmpty(info.AlarmMsg) == false ? info.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered);
|
| | | recordInfo.listMsg.Add(info.DemolishmenMsg);
|
| | | }
|
| | |
|
| | | //触发传感器报警
|
| | | if (recordInfo.listMsg.Count == 0)
|
| | | {
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered));
|
| | | }
|
| | | return true;
|
| | | }
|
| | |
| | | }
|
| | | //消息
|
| | | var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(receiveData);
|
| | | recordInfo.MsgText = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
|
| | | string MsgText = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
|
| | | recordInfo.listMsg.Add(MsgText);
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | //离家布防
|
| | | recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uRemoveHomeGarrison);
|
| | | //已执行
|
| | | recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
|
| | | }
|
| | | else
|
| | | {
|
| | | //已执行
|
| | | recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
|
| | | //没有内部防区
|
| | | if (HdlSafeguardLogic.Current.IsHadInternalDefenseArea() == false)
|
| | | {
|
| | |
| | | if (data.Result == 0)
|
| | | {
|
| | | //已执行
|
| | | recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
|
| | | //撤防
|
| | | recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uWithdrawGarrison);
|
| | | }
|
| | |
| | | //类型:逻辑名字
|
| | | recordInfo.MsgObjectText = receiveData["Data"]["LogicName"].ToString();
|
| | | //已执行
|
| | | recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
|
| | | }
|
| | |
|
| | | #endregion
|
| | |
| | | //类型:场景名字
|
| | | recordInfo.MsgObjectText = receiveData["Data"]["ScenesName"].ToString();
|
| | | //已执行
|
| | | recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
|
| | | recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
|
| | | }
|
| | |
|
| | | #endregion
|