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