예제 #1
0
    private void BindChildKey(string key, string childKey)
    {
        if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(childKey))
        {
            return;
        }

        RedPointData pointData = null;

        if (_redPointDataMap.ContainsKey(key))
        {
            pointData = _redPointDataMap[key];
        }
        else
        {
            pointData               = new RedPointData();
            pointData.key           = key;
            pointData.result        = false;
            pointData.filterMap     = new Dictionary <string, int>();
            pointData.childKeyList  = new List <string>();
            pointData.parentKeyList = new List <string>();
            _redPointDataMap.Add(key, pointData);
        }

        for (int i = 0; i < pointData.childKeyList.Count; i++)
        {
            if (pointData.childKeyList[i] == childKey)
            {
                return;
            }
        }

        pointData.childKeyList.Add(childKey);
    }
예제 #2
0
    private void BindKey_Internal(string key, Func <object, bool> activeFunc, SLua.LuaTable parentKeyList = null, SLua.LuaTable filterList = null)
    {
        if (string.IsNullOrEmpty(key))
        {
            return;
        }

        RedPointData pointData = null;

        if (_redPointDataMap.ContainsKey(key))
        {
            pointData = _redPointDataMap[key];
        }
        else
        {
            pointData               = new RedPointData();
            pointData.key           = key;
            pointData.result        = false;
            pointData.filterMap     = new Dictionary <string, int>();
            pointData.childKeyList  = new List <string>();
            pointData.parentKeyList = new List <string>();
            _redPointDataMap.Add(key, pointData);
        }

        pointData.checkActiveFunc = activeFunc;
        if (filterList != null)
        {
            pointData.filterMap.Clear();
            for (int i = 0; i < filterList.length(); i++)
            {
                pointData.filterMap.Add(filterList[i + 1].ToString(), 1);
            }
        }
        if (parentKeyList != null)
        {
            pointData.parentKeyList.Clear();
            for (int i = 0; i < parentKeyList.length(); i++)
            {
                var parentKey = parentKeyList[i + 1].ToString();
                if (string.IsNullOrEmpty(parentKey))
                {
                    continue;
                }

                pointData.parentKeyList.Add(parentKey);
                BindChildKey(parentKey, key);
            }
        }
    }
예제 #3
0
    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();
    }