Esempio n. 1
0
        /// <summary>
        /// Add an environment to the configuration
        /// </summary>
        /// <typeparam name="TEnvironment">The environment class to add</typeparam>
        /// <param name="configurator"></param>
        /// <param name="environmentFactory">The factory method to create the environment instance</param>
        public static void Add <TEnvironment>(this IEnvironmentsConfigurator configurator, Func <TEnvironment> environmentFactory)
            where TEnvironment : class, IServiceBusEnvironment
        {
            string environmentName = DefaultTypeNameConvention(typeof(TEnvironment));

            // do not collapse or 3.5 won't build
            configurator.Add(environmentName, environmentFactory);
        }
Esempio n. 2
0
 /// <summary>
 /// Add an environment to the configuration
 /// </summary>
 /// <typeparam name="TEnvironment">The environment class to add</typeparam>
 /// <param name="configurator"></param>
 /// <param name="environment">The environment instance already created and ready to use</param>
 public static void Add <TEnvironment>(this IEnvironmentsConfigurator configurator, TEnvironment environment)
     where TEnvironment : class, IServiceBusEnvironment
 {
     configurator.Add(() => environment);
 }
Esempio n. 3
0
        public static void Add(this IEnvironmentsConfigurator configurator, string environmentName, Action <IServiceBusConfigurator> environmentConfigurator)
        {
            var environment = new DelegateEnvironmentConfigurator(environmentConfigurator);

            configurator.Add(environmentName, () => environment);
        }
Esempio n. 4
0
 /// <summary>
 /// Add an environment to the configuration
 /// </summary>
 /// <typeparam name="TEnvironment">The environment class to add</typeparam>
 /// <param name="configurator"></param>
 public static void Add <TEnvironment>(this IEnvironmentsConfigurator configurator)
     where TEnvironment : class, IServiceBusEnvironment, new()
 {
     configurator.Add(() => new TEnvironment());
 }