public bool IsNeedNotice(INoticeKey rKey, string flag = null) { NoticeStateContent content; if (cache.TryGetValue(rKey, out content)) { return(content.complete && (!content.isRead || content.flag != flag)); } return(false); }
public void SetNoticeReadState(INoticeKey rKey, string rFlag = null) { NoticeStateContent content; if (cache.TryGetValue(rKey, out content)) { content.isRead = content.complete; content.flag = rFlag; } }
public void SetNoticeState(INoticeKey rKey, bool rComplete) { NoticeStateContent content; if (cache.TryGetValue(rKey, out content)) { content.complete = rComplete; } else { cache.Add(rKey, new NoticeStateContent { complete = rComplete }); } }
public bool GetCacheRead(INoticeKey key) { if (cache.ContainsKey(key)) { if (!cache[key].complete) { return(false); } if (!cache[key].isRead) { return(false); } } return(true); }