public void Update(IHandlerId data) { this.MessageType = data.MessageType; this.Description = data.Description; this.LogType = data.LogType; this.Location = data.Location; }
public HandlerIdViewModel(IHandlerId data) { _id = data.Id; _messageType = data.MessageType; _location = data.Location; _logType = data.LogType; _description = data.Description; }
public static DelegateHandler <TMessage> Access <TMessage>( Guid id, string description, LogEnum logType, Action <TMessage> action) { StackTrace ss = new StackTrace(false); Type location = ss.GetFrame(1).GetMethod().DeclaringType; IHandlerId handlerId = HandlerId.Create(typeof(TMessage), location, id, description, logType); return(MessageDispatcher.Register(handlerId, action)); }
// 修建消息(命令或事件)的运动路径 public static DelegateHandler <TMessage> Path <TMessage>(string description, LogEnum logType, Action <TMessage> action) { StackTrace ss = new StackTrace(false); // 0是Path,1是Accpt或On,2是当地 Type location = ss.GetFrame(2).GetMethod().DeclaringType; IHandlerId handlerId = HandlerId.Create(typeof(TMessage), location, description, logType); return(SMessageDispatcher.Register(handlerId, action)); }
public DelegateHandler(IHandlerId handlerId, Action <TMessage> action) { this.HandlerId = handlerId; _action = action; }
public DelegateHandler(IHandlerId handlerId, Action <TMessage> action) { this.HandlerId = handlerId; this.IsEnabled = true; _action = action; }
public static DelegateHandler <TMessage> Register <TMessage>(this IMessageDispatcher dispatcher, IHandlerId handlerId, Action <TMessage> action) { if (action == null) { throw new ArgumentNullException(nameof(action)); } DelegateHandler <TMessage> handler = new DelegateHandler <TMessage>(handlerId, action); dispatcher.Register(handler); return(handler); }