public static T AndNotSetIn <T>(this T to, ISubscriptionOptions @from)
     where T : ISubscriptionOptions
 {
     to.ClaimStatusChange   &= !from.ClaimStatusChange;
     to.Comments            &= !from.Comments;
     to.FieldChange         &= !from.FieldChange;
     to.MoneyOperation      &= !from.MoneyOperation;
     to.AccommodationChange &= !from.AccommodationChange;
     return(to);
 }
 public static T AssignFrom <T>(this T to, ISubscriptionOptions @from)
     where T : ISubscriptionOptions
 {
     to.ClaimStatusChange   = from.ClaimStatusChange;
     to.Comments            = from.Comments;
     to.FieldChange         = from.FieldChange;
     to.MoneyOperation      = from.MoneyOperation;
     to.AccommodationChange = from.AccommodationChange;
     return(to);
 }
Esempio n. 3
0
        /// <summary>
        /// manages the config for a subscriber. specifically setting up the queue name.
        /// </summary>
        /// <returns></returns>
        private MessageBusConfig GetSubscriberConfig(ISubscriptionOptions options)
        {
            // < Class Name > . < "Subscriber" >
            //conditionally provide add a processid if requested by the subscriber
            string queueFormat = String.Format("{0}{1}.Subscriber", typeof(TSubscriber).Name, options.PerProcessQueues? Process.GetCurrentProcess().Id.ToString(): string.Empty);

            return(new MessageBusConfig
            {
                QueueName = queueFormat// each instance must have its own address.
            });
        }
Esempio n. 4
0
        /// <summary>
        // Registers all the subscriptions defined by subscriber.
        /// </summary>
        private void Subscribe(TSubscriber subscriber, ISubscriptionOptions options)
        {
            // < Class Name > . < "Subscriber" >
            var config = GetSubscriberConfig(options);

            if (options != null)
            {
                if (options.ConcurrentConsumerLimit >= 1)
                {
                    config.Concurrency = options.ConcurrentConsumerLimit;
                }

                config.Permanent = options.Permanent;
            }
            CreateSubscriberBus(subscriber, config);
        }
 public static bool AnyNotSet(this ISubscriptionOptions request)
 {
     return(!request.AccommodationChange || !request.ClaimStatusChange ||
            !request.Comments || !request.FieldChange || !request.MoneyOperation);
 }