Example #1
0
 /// <summary>
 /// 注销委托
 /// </summary>
 /// <param name="MessageType"></param>
 public void UnloadHandle(ProtoEnum MessageType)
 {
     if (DicHandles.ContainsKey(MessageType))
     {
         throw new ArgumentException($"{MessageType}消息句柄不存在!");
     }
     DicHandles.Remove(MessageType);
 }
Example #2
0
 /// <summary>
 /// 获取委托
 /// </summary>
 /// <param name="messageType"></param>
 /// <returns></returns>
 public INetworkHandle GetHandle(ProtoEnum messageType)
 {
     if (DicHandles.TryGetValue(messageType, out INetworkHandle handle))
     {
         return(handle);
     }
     return(null);
 }
Example #3
0
 public bool Exist(ProtoEnum MessageType)
 {
     return(DicHandles.ContainsKey(MessageType));
 }