/// <summary> /// 从字典移除特定事件方法 /// </summary> /// <param name="type"></param> /// <param name="call"></param> public void RemoveEvent(string type, EventDelegateCallBack call) { if (_eventDict.ContainsKey(type)) { _eventDict[type] -= call; if (_eventDict[type] == null) { _eventDict.Remove(type); } } }
/// <summary> /// 添加特定事件方法入字典中 /// </summary> /// <param name="type"></param> /// <param name="call"></param> public void AddEvent(string type, EventDelegateCallBack call) { if (!_eventDict.ContainsKey(type)) { _eventDict[type] = call; } else { _eventDict[type] += call; } }