public static IHandlerId Create(Type messageType, Type location, Guid id, string description, LogEnum logType) { if (_dicById.ContainsKey(id)) { var item = _dicById[id]; item.MessageType = messageType; item.Location = location; item.Description = description; Global.Happened(new HandlerIdUpdatedEvent(item)); return(item); } else { var item = new HandlerId { MessageType = messageType, Location = location, Id = id, Description = description, LogType = logType }; _dicById.Add(id, item); if (Global.IsPublishHandlerIdAddedEvent) { Global.Happened(new HandlerIdAddedEvent(item)); } return(item); } }