Example #1
0
        /// <summary>
        /// 进行映射操作。
        /// </summary>
        /// <param name="key"></param>
        /// <param name="value"></param>
        public static void Map(IDeleBase key, Delegate value)
        {
            if (key == null)
            {
                throw new Exception("[Dele_Map_Delegate::GetDelegate()] key == null.");
            }
            string strKey = key.GetKey();

            m_Dict[strKey] = value;
        }
Example #2
0
        /// <summary>
        /// 销毁单个映射关系.
        /// </summary>
        public static void Destroy(IDeleBase key)
        {
            if (key == null)
            {
                throw new Exception("[Dele_Map_Delegate::Destriy()] key == null.");
            }
            string strKey = key.GetKey();

            if (m_Dict.ContainsKey(strKey))
            {
                m_Dict.Remove(strKey);
            }
        }
Example #3
0
        /// <summary>
        /// 获取 Delegate.
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public static Delegate GetDelegate(IDeleBase key)
        {
            if (key == null)
            {
                throw new Exception("[Dele_Map_Delegate::GetDelegate()] key == null.");
            }
            string strKey = key.GetKey();

            if (!m_Dict.ContainsKey(strKey))
            {
                //throw new Exception("[Dele_Map_Delegate::GetDelegate()] Count not find the key => " + key);
                return(null);
            }
            return(m_Dict[strKey]);
        }
Example #4
0
 /// <summary>
 /// 进行映射操作。
 /// </summary>
 /// <param name="key"></param>
 /// <param name="value"></param>
 public static void Map(IDeleBase key, Delegate value)
 {
     if (key == null) {
         throw new Exception("[Dele_Map_Delegate::GetDelegate()] key == null.");
     }
     string strKey = key.GetKey();
     m_Dict[strKey] = value;
 }
Example #5
0
 /// <summary>
 /// 获取 Delegate.
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public static Delegate GetDelegate(IDeleBase key)
 {
     if (key == null) {
         throw new Exception("[Dele_Map_Delegate::GetDelegate()] key == null.");
     }
     string strKey = key.GetKey();
     if (!m_Dict.ContainsKey(strKey)) {
         //throw new Exception("[Dele_Map_Delegate::GetDelegate()] Count not find the key => " + key);
         return null;
     }
     return m_Dict[strKey];
 }
Example #6
0
 /// <summary>
 /// 销毁单个映射关系.
 /// </summary>
 public static void Destroy(IDeleBase key)
 {
     if (key == null) {
         throw new Exception("[Dele_Map_Delegate::Destriy()] key == null.");
     }
     string strKey = key.GetKey();
     if (m_Dict.ContainsKey(strKey)) {
         m_Dict.Remove(strKey);
     }
 }