Beispiel #1
0
 public static void Execute(IWindsorContainer container, Action registrations)
 {
     using (AbstractConfigurationRunner.UseLocalContainer(container))
     {
         registrations();
     }
 }
Beispiel #2
0
 public static AbstractConfigurationRunner Read(
     IWindsorContainer container, Stream stream,
     GenerationOptions generationOptions, string name,
     string environment, params string[] namespaces)
 {
     try
     {
         using (AbstractConfigurationRunner.UseLocalContainer(container))
         {
             AbstractConfigurationRunner conf = GetConfigurationInstanceFromStream(
                 name, environment, container, stream, generationOptions, namespaces);
             using (AbstractConfigurationRunner.CaptureRegistrations())
             {
                 conf.Run();
             }
             foreach (INeedSecondPassRegistration needSecondPassRegistration in NeedSecondPassRegistrations)
             {
                 needSecondPassRegistration.RegisterSecondPass();
             }
             return(conf);
         }
     }
     finally
     {
         NeedSecondPassRegistrations = null;
     }
 }
 void IWindsorInstaller.Install(IWindsorContainer container, IConfigurationStore store)
 {
     if (reusable && runner != null)
     {
         BinsorScript.FromRunner(runner).InstallInto(container);
     }
     else
     {
         runner = InstallInto(container);
     }
 }
Beispiel #4
0
 public static AbstractConfigurationRunner Read(
     IWindsorContainer container, CustomUri uri,
     GenerationOptions generationOptions, string name,
     string environment, params string[] namespaces)
 {
     using (AbstractConfigurationRunner.UseLocalContainer(container))
     {
         var conf = GetConfigurationInstanceFromResource(name, environment, container, uri, generationOptions, namespaces);
         conf.Run();
         return(conf);
     }
 }
Beispiel #5
0
        public static BinsorRunnerInstaller FromCompiledAssembly(Assembly assembly)
        {
            foreach (Type type in assembly.GetExportedTypes())
            {
                if (type.IsClass && !type.IsAbstract &&
                    typeof(AbstractConfigurationRunner).IsAssignableFrom(type))
                {
                    AbstractConfigurationRunner runner = (AbstractConfigurationRunner)Activator.CreateInstance(type);
                    return(FromRunner(runner));
                }
            }

            throw new ArgumentException(
                      string.Format("Assembly {0} does not appear to be a Binsor assembly",
                                    assembly.FullName));
        }
Beispiel #6
0
 public static AbstractConfigurationRunner Read(
     IWindsorContainer container, string fileName, string environment,
     GenerationOptions generationOptions, params string[] namespaces)
 {
     try
     {
         AbstractConfigurationRunner conf = GetConfigurationInstanceFromFile(
             fileName, environment, container, generationOptions, namespaces);
         Execute(container, conf);
         return(conf);
     }
     finally
     {
         NeedSecondPassRegistrations = null;
     }
 }
Beispiel #7
0
        public static void Execute(IWindsorContainer container, AbstractConfigurationRunner abstractConfiguration)
        {
            try
            {
                using (AbstractConfigurationRunner.UseLocalContainer(container))
                {
                    using (AbstractConfigurationRunner.CaptureRegistrations())
                    {
                        abstractConfiguration.Run();
                    }

                    foreach (INeedSecondPassRegistration needSecondPassRegistration in NeedSecondPassRegistrations)
                    {
                        needSecondPassRegistration.RegisterSecondPass();
                    }
                }
            }
            finally
            {
                NeedSecondPassRegistrations = null;
            }
        }
 public BinsorRunnerInstaller(AbstractConfigurationRunner runner)
 {
     this.runner = runner;
 }
Beispiel #9
0
        public static void Execute(IWindsorContainer container, AbstractConfigurationRunner abstractConfiguration)
        {
            try
            {
                using(AbstractConfigurationRunner.UseLocalContainer(container))
                {
                    using (AbstractConfigurationRunner.CaptureRegistrations())
                    {
                        abstractConfiguration.Run();
                    }

                    foreach(INeedSecondPassRegistration needSecondPassRegistration in NeedSecondPassRegistrations)
                    {
                        needSecondPassRegistration.RegisterSecondPass();
                    }
                }
            }
            finally
            {
                NeedSecondPassRegistrations = null;
            }
        }
Beispiel #10
0
 public static BinsorRunnerInstaller FromRunner(AbstractConfigurationRunner runner)
 {
     return(new BinsorRunnerInstaller(runner));
 }
 public static BinsorRunnerInstaller FromRunner(AbstractConfigurationRunner runner)
 {
     return new BinsorRunnerInstaller(runner);
 }
Beispiel #12
0
 public static void Execute(IWindsorContainer container, AbstractConfigurationRunner abstractConfiguration)
 {
     Execute(container, () => abstractConfiguration.Run());
 }
Beispiel #13
0
 public static void Execute(IWindsorContainer container, AbstractConfigurationRunner abstractConfiguration)
 {
     Execute(container, () => abstractConfiguration.Run());
 }