/// <summary> /// 检查红点提示,内部调用; /// </summary> /// <param name="redDotType"></param> /// <returns></returns> private bool Check(RedDotType redDotType, object[] objs) { if (RedDotConditionDict.ContainsKey(redDotType)) { return(RedDotConditionDict[redDotType].ShowRedDot(objs)); } return(false); }
/// <summary> /// 添加红点界面; /// </summary> /// <param name="redDotType"></param> /// <param name="item"></param> private void RegisterRedDot(RedDotType redDotType, RedDotItem item) { if (RedDotObjDict.ContainsKey(redDotType)) { RedDotObjDict[redDotType].Add(item); } else { List <RedDotItem> items = new List <RedDotItem>(); items.Add(item); RedDotObjDict.Add(redDotType, items); } }
/// <summary> /// 更新该类型的所有红点组件; /// </summary> /// <param name="redDotType"></param> /// <returns></returns> public void NotifyAll(RedDotType redDotType, object[] objs = null) { if (RedDotObjDict.ContainsKey(redDotType)) { for (int i = 0; i < RedDotObjDict[redDotType].Count; i++) { RedDotItem item = RedDotObjDict[redDotType][i]; if (item != null) { List <RedDotType> redDotTypes = item.GetRedDotTypes(); bool bCheck = Check(redDotTypes, objs); item.SetData(bCheck); } } } }
public override void Initialize() { base.Initialize(); if (this.Args == null) { return; } checkHandler = RegEventHandler <CEvent.RedDot.Refresh>(OnRefreshEvent); RedPointData redData = this.Args[0] as RedPointData; dotType = redData.dot; mCheck = redData.cb; ShowDot(); }