private List <TalkToSend> ToTalkList(List <Dictionary <string, string> > mapList) { List <TalkToSend> list = new List <TalkToSend>(); foreach (var value in mapList) { TalkToSend talk = JsonConvert.DeserializeObject <TalkToSend>(JsonConvert.SerializeObject(value, serializerSetting), serializerSetting); list.Add(talk); } return(list); }
/// <summary> /// Check is talk after lastTalk. /// <para>If it is same, return false.</para> /// </summary> /// <param name="talk"></param> /// <param name="lastTalk"></param> /// <returns></returns> private bool IsAfter(TalkToSend talk, Talk lastTalk) { if (lastTalk != null) { if (talk.Day < lastTalk.Day) { return(false); } if (talk.Day == lastTalk.Day && talk.Idx <= lastTalk.Idx) { return(false); } } return(true); }
/// <summary> /// Check is talk after lastTalk. /// <para>If it is same, return false.</para> /// </summary> /// <param name="talk"></param> /// <param name="lastTalk"></param> /// <returns></returns> private bool IsAfter(TalkToSend talk, Talk lastTalk) { if (lastTalk != null) { if (talk.Day < lastTalk.Day) { return false; } if (talk.Day == lastTalk.Day && talk.Idx <= lastTalk.Idx) { return false; } } return true; }