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