public SocketEvent Clone() { SocketEvent evt = new SocketEvent(); evt.Reset(_callback, _type); return(evt); }
public void AddCmdListener(int cmdID, Action <object> listener) { Dictionary <Action <object>, SocketEvent> eventListenrDic; _cmdEventDic.TryGetValue(cmdID, out eventListenrDic); if (eventListenrDic == null) { eventListenrDic = new Dictionary <Action <object>, SocketEvent>(); _cmdEventDic.Add(cmdID, eventListenrDic); } if (eventListenrDic.ContainsKey(listener)) { return; } SocketEvent evt = new SocketEvent(); evt.Reset(listener); eventListenrDic.Add(listener, evt); }