コード例 #1
0
        /// <summary>
        /// 注册wrap的函数
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="callerWrap"></param>
        public void RegWrapInterface <T>(T callerWrap, object listInst)
        {
            string typeName = typeof(T).FullName;

            DLogger.Assert(!m_entry.ContainsKey(typeName));

            var entry = new DEventEntryData();

            entry.m_interfaceWrap   = callerWrap;
            entry.m_listIntefaceImp = listInst;
            m_entry.Add(typeName, entry);
        }
コード例 #2
0
        /// <summary>
        /// 注册实现了UI事件接口的对象
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="interfaceObj"></param>
        public void AddInteface <T>(T interfaceObj)
        {
            string key = typeof(T).FullName;


            DEventEntryData entry;

            if (!m_entry.TryGetValue(key, out entry))
            {
                DLogger.Assert(false);
                return;
            }

            List <T> listInter = entry.m_listIntefaceImp as List <T>;

            listInter.Add(interfaceObj);
        }