Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectorBindingGenerator"/> class.
 /// </summary>
 /// <param name="bindingCreator">The binding creator.</param>
 /// <param name="selector">The selection delegate.</param>
 /// <param name="bindableTypeSelector">The bindable type selector.</param>
 public SelectorBindingGenerator(
     IBindingCreator bindingCreator,
     ServiceSelector selector,
     IBindableTypeSelector bindableTypeSelector)
 {
     this.Selector             = selector;
     this.bindingCreator       = bindingCreator;
     this.bindableTypeSelector = bindableTypeSelector;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SelectorBindingGenerator"/> class.
 /// </summary>
 /// <param name="bindingCreator">The binding creator.</param>
 /// <param name="selector">The selection delegate.</param>
 /// <param name="bindableTypeSelector">The bindable type selector.</param>
 public SelectorBindingGenerator(
     IBindingCreator bindingCreator, 
     ServiceSelector selector, 
     IBindableTypeSelector bindableTypeSelector)
 {
     this.Selector = selector;
     this.bindingCreator = bindingCreator;
     this.bindableTypeSelector = bindableTypeSelector;
 }
Example #3
0
        public void BindToSelection()
        {
            ServiceSelector selector  = (t1, t2) => t2;
            var             generator = new Mock <IBindingGenerator>().Object;

            this.bindingGeneratorFactoryMock.Setup(g => g.CreateSelectorBindingGenerator(selector)).Returns(generator);

            this.testee.BindSelection(selector);

            this.conventionBindingBuilderMock.Verify(b => b.BindWith(generator));
        }
Example #4
0
 /// <summary>
 /// Binds the selected interfaces to the type.
 /// </summary>
 /// <param name="selector">The selector of the interfaces.</param>
 /// <returns>The fluent syntax</returns>
 public IConfigureSyntax BindSelection(ServiceSelector selector)
 {
     return(this.BindWith(this.bindingGeneratorFactory.CreateSelectorBindingGenerator(selector)));
 }
Example #5
0
		/// <summary>
		///   Assigns a custom service selection strategy.
		/// </summary>
		/// <param name = "selector"></param>
		/// <returns></returns>
		public BasedOnDescriptor Select(ServiceSelector selector)
		{
			serviceSelector += selector;
			return basedOnDescriptor;
		}
Example #6
0
		/// <summary>
		/// Assigns a custom service selection strategy.
		/// </summary>
		/// <param name="selector"></param>
		/// <returns></returns>
		public BasedOnDescriptor Select(ServiceSelector selector)
		{
			useBaseType = false;
			serviceSelector = selector;
			return basedOnDescriptor;
		}
 /// <summary>
 /// Creates a selector binding generator.
 /// </summary>
 /// <param name="selector">The selector.</param>
 /// <returns>The newly created generator.</returns>
 public IBindingGenerator CreateSelectorBindingGenerator(ServiceSelector selector)
 {
     return new SelectorBindingGenerator(this.CreateSingleBindingCreator(), selector, this.bindableTypeSelector);
 }
Example #8
0
 /// <summary>
 /// Creates a selector binding generator.
 /// </summary>
 /// <param name="selector">The selector.</param>
 /// <returns>The newly created generator.</returns>
 public IBindingGenerator CreateSelectorBindingGenerator(ServiceSelector selector)
 {
     return(new SelectorBindingGenerator(this.CreateSingleBindingCreator(), selector, this.bindableTypeSelector));
 }
Example #9
0
 /// <summary>
 ///   Assigns a custom service selection strategy.
 /// </summary>
 /// <param name = "selector"></param>
 /// <returns></returns>
 public BasedOnDescriptor Select(ServiceSelector selector)
 {
     serviceSelector += selector;
     return(basedOnDescriptor);
 }
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (MessageProperties != null)
         {
             hashCode = hashCode * 59 + MessageProperties.GetHashCode();
         }
         if (MessageBoxSizeLimit != null)
         {
             hashCode = hashCode * 59 + MessageBoxSizeLimit.GetHashCode();
         }
         if (MessageCountLimit != null)
         {
             hashCode = hashCode * 59 + MessageCountLimit.GetHashCode();
         }
         if (NotifyFailure != null)
         {
             hashCode = hashCode * 59 + NotifyFailure.GetHashCode();
         }
         if (FailureMessageFrom != null)
         {
             hashCode = hashCode * 59 + FailureMessageFrom.GetHashCode();
         }
         if (FailureTemplatePath != null)
         {
             hashCode = hashCode * 59 + FailureTemplatePath.GetHashCode();
         }
         if (MaxRetries != null)
         {
             hashCode = hashCode * 59 + MaxRetries.GetHashCode();
         }
         if (MinWaitBetweenRetries != null)
         {
             hashCode = hashCode * 59 + MinWaitBetweenRetries.GetHashCode();
         }
         if (CountUpdatePoolSize != null)
         {
             hashCode = hashCode * 59 + CountUpdatePoolSize.GetHashCode();
         }
         if (InboxPath != null)
         {
             hashCode = hashCode * 59 + InboxPath.GetHashCode();
         }
         if (SentitemsPath != null)
         {
             hashCode = hashCode * 59 + SentitemsPath.GetHashCode();
         }
         if (SupportAttachments != null)
         {
             hashCode = hashCode * 59 + SupportAttachments.GetHashCode();
         }
         if (SupportGroupMessaging != null)
         {
             hashCode = hashCode * 59 + SupportGroupMessaging.GetHashCode();
         }
         if (MaxTotalRecipients != null)
         {
             hashCode = hashCode * 59 + MaxTotalRecipients.GetHashCode();
         }
         if (BatchSize != null)
         {
             hashCode = hashCode * 59 + BatchSize.GetHashCode();
         }
         if (MaxTotalAttachmentSize != null)
         {
             hashCode = hashCode * 59 + MaxTotalAttachmentSize.GetHashCode();
         }
         if (AttachmentTypeBlacklist != null)
         {
             hashCode = hashCode * 59 + AttachmentTypeBlacklist.GetHashCode();
         }
         if (AllowedAttachmentTypes != null)
         {
             hashCode = hashCode * 59 + AllowedAttachmentTypes.GetHashCode();
         }
         if (ServiceSelector != null)
         {
             hashCode = hashCode * 59 + ServiceSelector.GetHashCode();
         }
         if (FieldWhitelist != null)
         {
             hashCode = hashCode * 59 + FieldWhitelist.GetHashCode();
         }
         return(hashCode);
     }
 }
        /// <summary>
        /// Returns true if ComAdobeCqSocialMessagingClientEndpointsImplMessagingOperationProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of ComAdobeCqSocialMessagingClientEndpointsImplMessagingOperationProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(ComAdobeCqSocialMessagingClientEndpointsImplMessagingOperationProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     MessageProperties == other.MessageProperties ||
                     MessageProperties != null &&
                     MessageProperties.Equals(other.MessageProperties)
                     ) &&
                 (
                     MessageBoxSizeLimit == other.MessageBoxSizeLimit ||
                     MessageBoxSizeLimit != null &&
                     MessageBoxSizeLimit.Equals(other.MessageBoxSizeLimit)
                 ) &&
                 (
                     MessageCountLimit == other.MessageCountLimit ||
                     MessageCountLimit != null &&
                     MessageCountLimit.Equals(other.MessageCountLimit)
                 ) &&
                 (
                     NotifyFailure == other.NotifyFailure ||
                     NotifyFailure != null &&
                     NotifyFailure.Equals(other.NotifyFailure)
                 ) &&
                 (
                     FailureMessageFrom == other.FailureMessageFrom ||
                     FailureMessageFrom != null &&
                     FailureMessageFrom.Equals(other.FailureMessageFrom)
                 ) &&
                 (
                     FailureTemplatePath == other.FailureTemplatePath ||
                     FailureTemplatePath != null &&
                     FailureTemplatePath.Equals(other.FailureTemplatePath)
                 ) &&
                 (
                     MaxRetries == other.MaxRetries ||
                     MaxRetries != null &&
                     MaxRetries.Equals(other.MaxRetries)
                 ) &&
                 (
                     MinWaitBetweenRetries == other.MinWaitBetweenRetries ||
                     MinWaitBetweenRetries != null &&
                     MinWaitBetweenRetries.Equals(other.MinWaitBetweenRetries)
                 ) &&
                 (
                     CountUpdatePoolSize == other.CountUpdatePoolSize ||
                     CountUpdatePoolSize != null &&
                     CountUpdatePoolSize.Equals(other.CountUpdatePoolSize)
                 ) &&
                 (
                     InboxPath == other.InboxPath ||
                     InboxPath != null &&
                     InboxPath.Equals(other.InboxPath)
                 ) &&
                 (
                     SentitemsPath == other.SentitemsPath ||
                     SentitemsPath != null &&
                     SentitemsPath.Equals(other.SentitemsPath)
                 ) &&
                 (
                     SupportAttachments == other.SupportAttachments ||
                     SupportAttachments != null &&
                     SupportAttachments.Equals(other.SupportAttachments)
                 ) &&
                 (
                     SupportGroupMessaging == other.SupportGroupMessaging ||
                     SupportGroupMessaging != null &&
                     SupportGroupMessaging.Equals(other.SupportGroupMessaging)
                 ) &&
                 (
                     MaxTotalRecipients == other.MaxTotalRecipients ||
                     MaxTotalRecipients != null &&
                     MaxTotalRecipients.Equals(other.MaxTotalRecipients)
                 ) &&
                 (
                     BatchSize == other.BatchSize ||
                     BatchSize != null &&
                     BatchSize.Equals(other.BatchSize)
                 ) &&
                 (
                     MaxTotalAttachmentSize == other.MaxTotalAttachmentSize ||
                     MaxTotalAttachmentSize != null &&
                     MaxTotalAttachmentSize.Equals(other.MaxTotalAttachmentSize)
                 ) &&
                 (
                     AttachmentTypeBlacklist == other.AttachmentTypeBlacklist ||
                     AttachmentTypeBlacklist != null &&
                     AttachmentTypeBlacklist.Equals(other.AttachmentTypeBlacklist)
                 ) &&
                 (
                     AllowedAttachmentTypes == other.AllowedAttachmentTypes ||
                     AllowedAttachmentTypes != null &&
                     AllowedAttachmentTypes.Equals(other.AllowedAttachmentTypes)
                 ) &&
                 (
                     ServiceSelector == other.ServiceSelector ||
                     ServiceSelector != null &&
                     ServiceSelector.Equals(other.ServiceSelector)
                 ) &&
                 (
                     FieldWhitelist == other.FieldWhitelist ||
                     FieldWhitelist != null &&
                     FieldWhitelist.Equals(other.FieldWhitelist)
                 ));
        }