コード例 #1
0
        /// <summary>
        /// 外部推送ui数据
        /// </summary>
        /// <param name="uiIndex"></param>
        /// <param name="data"></param>
        public void SendMessage(Enum Index, WinData data)
        {
            var uiIndex = Index.GetHashCode();

            if (windowMap.ContainsKey(uiIndex))
            {
                var ui = windowMap[uiIndex];

                if (ui.IsLoad)
                {
                    ui.SendMessage(data);
                    return;
                }
            }

            //存入缓存
            List <WinData> list = null;

            uiDataCacheMap.TryGetValue(uiIndex, out list);
            //
            if (list == null)
            {
                list = new List <WinData>();
                uiDataCacheMap[uiIndex] = list;
            }
            list.Add(data);
        }
コード例 #2
0
        /// <summary>
        /// 外部推送ui数据
        /// </summary>
        /// <param name="uiEnum"></param>
        /// <param name="data"></param>
        public void PushData(WinEnum uiEnum, WinData data)
        {
            if (windowMap.ContainsKey(uiEnum))
            {
                var ui = windowMap[uiEnum];

                if (ui.IsLoad)
                {
                    ui.PushData(data);
                    return;
                }
            }

            //存入缓存
            List <WinData> list = null;

            uiDataCacheMap.TryGetValue(uiEnum, out list);
            //
            if (list == null)
            {
                list = new List <WinData>();
                uiDataCacheMap[uiEnum] = list;
            }
            list.Add(data);
        }