public MessageService( MessageConfig messageConfig, IMessageAction <Schedule> scheduleAction, IMessageAction <Payment> paymentAction, ITelemetryProvider telemetryProvider) { this.messageConfig = messageConfig; this.scheduleAction = scheduleAction; this.paymentAction = paymentAction; this.telemetryProvider = telemetryProvider; }
public MsmqTransport( IMessageSerializer serializer, Uri endpoint, int threadCount, IMessageAction[] messageActions) { this.serializer = serializer; this.messageActions = messageActions; this.endpoint = endpoint; this.threadCount = threadCount; waitHandles = new WaitHandle[threadCount]; }
public static MessageAction ToMessageAction(this IMessageAction self) { if (self.Label == null) { throw new InvalidOperationException("The label cannot be null."); } if (self.Text == null) { throw new InvalidOperationException("The text cannot be null."); } if (self is MessageAction messageAction) { return(messageAction); } return(new MessageAction() { Label = self.Label, Text = self.Text }); }
internal static MessageAction Convert(IMessageAction action) { if (action.Label == null) { throw new InvalidOperationException("The label cannot be null."); } if (action.Text == null) { throw new InvalidOperationException("The text cannot be null."); } if (action is MessageAction messageAction) { return(messageAction); } return(new MessageAction() { Label = action.Label, Text = action.Text }); }
public Receiver(MessageConfig messageConfig, IMessageAction <T> messageAction, ITelemetryProvider telemetryProvider) { action = messageAction; this.messageConfig = messageConfig; this.telemetryProvider = telemetryProvider; }
public static Message Parse(IMessageAction message) { string key = message.GetType().FullName; return(Switch[key](message)); }