public void Deliver(IMapleMessage message)
 {
     if (!(message is TMessage))
     {
         throw new ArgumentException("Message is not the correct type"); // TODO translate
     }
     DeliveryAction.Invoke(message as TMessage);
 }
        public void Deliver(IMapleMessage message)
        {
            if (!(message is TMessage))
            {
                throw new ArgumentException("Message is not the correct type"); // TODO translate
            }
            if (!DeliveryAction.IsAlive)
            {
                return;
            }

            ((Action <TMessage>)DeliveryAction.Target).Invoke(message as TMessage);
        }
        public bool ShouldAttemptDelivery(IMapleMessage message)
        {
            if (message == null)
            {
                return(false);
            }

            if (!(typeof(TMessage).IsAssignableFrom(message.GetType())))
            {
                return(false);
            }

            return(MessageFilter.Invoke(message as TMessage));
        }
        public bool ShouldAttemptDelivery(IMapleMessage message)
        {
            if (message == null)
            {
                return(false);
            }

            if (!(typeof(TMessage).IsAssignableFrom(message.GetType())))
            {
                return(false);
            }

            if (!DeliveryAction.IsAlive)
            {
                return(false);
            }

            if (!MessageFilter.IsAlive)
            {
                return(false);
            }

            return(((Func <TMessage, bool>)MessageFilter.Target).Invoke(message as TMessage));
        }
Пример #5
0
 public void Handle(IMapleMessage message, Exception exception)
 {
     throw exception;
 }
Пример #6
0
 public void Deliver(IMapleMessage message, IMapleMessageSubscription subscription)
 {
     Message = message;
     subscription.Deliver(message);
 }
Пример #7
0
 private void UpdateMainMediaPlayer(IMapleMessage obj)
 {
     //var main = obj.Sender as MainMediaPlayer;
     //MainMediaPlayer = (MainMediaPlayer)_mediaplayers.Items.ToList().Find(p => p is MainMediaPlayer);
 }