private IConfigurationContext MergeConfiguration(IConfigurationContext context)
        {
            var defaultSettings = new Configuration.ConfigurationSettings();
            var configSection   = ConfigurationHelper.GetConfigSection <Configuration.ConfigurationSection>();

            // If the value is in the config use that
            // Otherwise, if the value is already set via fluent config use that
            // Otherwise use the default value
            if (configSection != null)
            {
                if (!String.IsNullOrWhiteSpace(configSection.Hostname))
                {
                    context.SetHostname(configSection.Hostname);
                }
                else if (context.GetHostname() == null)
                {
                    context.SetHostname(defaultSettings.Hostname);
                }

                if (!String.IsNullOrWhiteSpace(configSection.MulticastAddress))
                {
                    context.SetMulticastAddress(configSection.MulticastAddress);
                }
                else if (context.GetMulticastAddress() == null)
                {
                    context.SetMulticastAddress(defaultSettings.MulticastAddress);
                }
            }

            return(context);
        }
        public static FluentConfigurationSource UseMSMQ(this FluentConfigurationSource builder, Action<ConfigurationSettings> settingsFactory)
        {
            var settings = new ConfigurationSettings();
            settingsFactory(settings);

            return builder.UsingTransport<MSMQTransport>(context =>
            {
                context.SetMulticastAddress(settings.MulticastAddress);
                context.SetHostname(settings.Hostname);
            });
        }