コード例 #1
0
ファイル: sdNewInfoMgr.cs プロジェクト: tsinglee2009/Dczg
    public void ClearNewInfo(NewInfoType type)
    {
        if (infoList[type] == null)
        {
            infoList.Add(type, false);
        }
        else
        {
            infoList[type] = false;
        }

        ChangeInfo(type, false);
    }
コード例 #2
0
ファイル: sdNewInfoMgr.cs プロジェクト: tsinglee2009/Dczg
    public void CreateNewInfo(NewInfoType type)
    {
        if (infoList[type] == null)
        {
            infoList.Add(type, true);
        }
        else
        {
            infoList[type] = true;
        }

        ChangeInfo(type, true);
    }
コード例 #3
0
ファイル: sdNewInfoMgr.cs プロジェクト: tsinglee2009/Dczg
    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);
            }
        }
    }