Example #1
0
        public DefaultReceiver(string id)
        {
            ID             = id;
            Handling       = false;
            MsgList        = new Queue();
            MsgMethodInfos = new Dictionary <uint, JMethodInfo>();
            MsgHandlers    = new Dictionary <uint, MsgAction <Message> >();

            MsgMonitor.RegisteReceiver(this);

            RegisteMsgHandler(MsgType.Dispose, Dispose);

            ParseMsgHandler(this);
        }
Example #2
0
 public void RegisteReceiveMsg(uint msg, JMethodInfo method)
 {
     MsgMonitor.RegisteMsgReceiver(msg, this);
     RegisteMsgHandler(msg, method);
 }
Example #3
0
 public void RegisteReceiveMsg(uint msg, MsgAction <Message> action)
 {
     MsgMonitor.RegisteMsgReceiver(msg, this);
     RegisteMsgHandler(msg, action);
 }
Example #4
0
 public void CreateAndPostMsg(uint msg, string[] receivers = null, object wParam = null, object lParam = null)
 {
     MsgMonitor.CreateAndPostMsg(msg, ID, receivers, wParam, lParam);
 }
Example #5
0
 public Dictionary <string, object> CreateAndSendMsg(uint msg, string[] receivers = null, object wParam = null, object lParam = null)
 {
     return(MsgMonitor.CreateAndSendMsg(msg, ID, null, wParam, lParam));
 }
Example #6
0
 //[MsgHandler(MsgType.Dispose, false, "释放消息")]
 protected virtual object Dispose(Message msg)
 {
     MsgMonitor.RemoveReceiver(ID);
     return(null);
 }
Example #7
0
 public void RemoveReceiveMsg(uint msg)
 {
     MsgMonitor.RemoveMsgReceiver(msg, this);
     RemoveMsgHandler(msg);
 }