示例#1
0
    public void ClearNewInfo(NewInfoType type)
    {
        if (infoList[type] == null)
        {
            infoList.Add(type, false);
        }
        else
        {
            infoList[type] = false;
        }

        ChangeInfo(type, false);
    }
示例#2
0
    public void CreateNewInfo(NewInfoType type)
    {
        if (infoList[type] == null)
        {
            infoList.Add(type, true);
        }
        else
        {
            infoList[type] = true;
        }

        ChangeInfo(type, true);
    }
示例#3
0
    void ChangeInfo(NewInfoType type, bool flag)
    {
        if (!childList.ContainsKey(type) || childList[type] == null)
        {
            return;
        }
        List <sdNewInfo> list = childList[type];

        foreach (sdNewInfo item in list)
        {
            item.ShowOrHide(flag);
        }

        hasNew = false;
        foreach (string item in Enum.GetNames(typeof(NewInfoType)))
        {
            NewInfoType temp = (NewInfoType)Enum.Parse(typeof(NewInfoType), item);
            if (temp == NewInfoType.Type_All)
            {
                continue;
            }
            if (infoList.ContainsKey(temp) && infoList[temp] != null)
            {
                if ((bool)infoList[temp] == true)
                {
                    hasNew = true;
                    break;
                }
            }
        }

        if (childList.ContainsKey(NewInfoType.Type_All) && childList[NewInfoType.Type_All] != null)
        {
            List <sdNewInfo> alllist = childList[NewInfoType.Type_All];
            foreach (sdNewInfo item in alllist)
            {
                item.SetNew(hasNew);
            }
        }
    }