Ejemplo n.º 1
0
		public RoutingOverride(RoutingDomain routingDomain, RoutingHost alternateDeliveryRoutingHost, DeliveryQueueDomain deliveryQueueDomain)
		{
			if (routingDomain == RoutingDomain.Empty)
			{
				throw new ArgumentException(string.Format("The provided domain '{0}' is RoutingDomain.Empty which isn't valid for RoutingOverride", routingDomain));
			}
			if (alternateDeliveryRoutingHost == null && deliveryQueueDomain == DeliveryQueueDomain.UseAlternateDeliveryRoutingHosts)
			{
				throw new ArgumentException(string.Format("The provided delivery queue domain value UseAlternateDeliveryRoutingHosts is only valid when you specify alternate delivery hosts.", new object[0]));
			}
			if (alternateDeliveryRoutingHost != null && !string.Equals(routingDomain.Type, "smtp", StringComparison.OrdinalIgnoreCase))
			{
				throw new ArgumentException(string.Format("The routing domain needs to be an SMTP domain if alternate delivery hosts are specified - routingDomain.Type == {0}", routingDomain.Type));
			}
			this.routingDomain = routingDomain;
			this.alternateDeliveryRoutingHosts = alternateDeliveryRoutingHost.ToString();
			this.deliveryQueueDomain = deliveryQueueDomain;
		}
Ejemplo n.º 2
0
        internal static string ConvertRoutingHostsToString <T>(IList <T> routingHostWrappers, Func <T, RoutingHost> routingHostGetter)
        {
            if (routingHostWrappers == null || routingHostWrappers.Count == 0 || routingHostGetter == null)
            {
                return(string.Empty);
            }
            StringBuilder stringBuilder = new StringBuilder();
            int           num           = 0;

            foreach (T arg in routingHostWrappers)
            {
                RoutingHost routingHost = routingHostGetter(arg);
                num++;
                stringBuilder.Append(routingHost.ToString());
                if (num < routingHostWrappers.Count)
                {
                    stringBuilder.Append(',');
                }
            }
            return(stringBuilder.ToString());
        }