Exemple #1
0
        void addHandler(IMessageSystemHandler interface_handler)
        {
            string msg_uid = interface_handler.getMessageUid;

            if (!messageHandlersMap.ContainsKey(msg_uid))
            {
                messageHandlersMap.Add(msg_uid, new Dictionary <int, MessageHandler>());
            }

            var handlerDic   = messageHandlersMap[msg_uid];
            var handler_hash = interface_handler.GetHashCode();

            if (!handlerDic.ContainsKey(handler_hash))
            {
                MessageHandler handler = new MessageHandler(interface_handler);
                handlerDic.Add(handler_hash, handler);
            }
        }
Exemple #2
0
 static string Handler2Identiry(IMessageSystemHandler handler)
 {
     return(handler.getMessageUid + "+" + handler.GetHashCode());
 }