Ejemplo n.º 1
0
 public MessageService(
     MessageConfig messageConfig,
     IMessageAction <Schedule> scheduleAction,
     IMessageAction <Payment> paymentAction,
     ITelemetryProvider telemetryProvider)
 {
     this.messageConfig     = messageConfig;
     this.scheduleAction    = scheduleAction;
     this.paymentAction     = paymentAction;
     this.telemetryProvider = telemetryProvider;
 }
Ejemplo n.º 2
0
 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
            });
        }
Ejemplo n.º 4
0
        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
            });
        }
Ejemplo n.º 5
0
 public Receiver(MessageConfig messageConfig, IMessageAction <T> messageAction, ITelemetryProvider telemetryProvider)
 {
     action                 = messageAction;
     this.messageConfig     = messageConfig;
     this.telemetryProvider = telemetryProvider;
 }
Ejemplo n.º 6
0
        public static Message Parse(IMessageAction message)
        {
            string key = message.GetType().FullName;

            return(Switch[key](message));
        }