public void RefreshMessages(string message) { var model = JsonConvert.DeserializeObject <TheNotifications>(message); var HandChatRecord = new HandChatRecordViewModel() { IdProperty = InitializeData.HandChatRecordData.Max(x => x.IdProperty) + 1, SourceIdProperty = model.SourceId, TargetIdProperty = model.TargetId, ContentProperty = model.Content, RecordDateTime = DateTime.Now }; InitializeData.HandChatRecordData.Add(HandChatRecord); Initialize(); }
public static List <HandChatRecordViewModel> HandChatRecordInitializeData() { var HandChatRecordData = new List <HandChatRecordViewModel>(); var handChatRecord0 = new HandChatRecordViewModel() { IdProperty = 1, SourceIdProperty = 1, TargetIdProperty = 2, ContentProperty = "你好啊", RecordDateTime = DateTime.Now }; var handChatRecord1 = new HandChatRecordViewModel() { IdProperty = 2, SourceIdProperty = 2, TargetIdProperty = 1, ContentProperty = "我很好", RecordDateTime = DateTime.Now }; var handChatRecord2 = new HandChatRecordViewModel() { IdProperty = 1, SourceIdProperty = 1, TargetIdProperty = 3, ContentProperty = "你好啊", RecordDateTime = DateTime.Now }; var handChatRecord3 = new HandChatRecordViewModel() { IdProperty = 1, SourceIdProperty = 3, TargetIdProperty = 1, ContentProperty = "你好啊", RecordDateTime = DateTime.Now }; HandChatRecordData.Add(handChatRecord0); HandChatRecordData.Add(handChatRecord1); HandChatRecordData.Add(handChatRecord2); HandChatRecordData.Add(handChatRecord3); return(HandChatRecordData); }