Пример #1
0
 public static void Execute(IWindsorContainer container, Action registrations)
 {
     using (AbstractConfigurationRunner.UseLocalContainer(container))
     {
         registrations();
     }
 }
Пример #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;
     }
 }
Пример #3
0
 void IWindsorInstaller.Install(IWindsorContainer container, IConfigurationStore store)
 {
     if (reusable && runner != null)
     {
         BinsorScript.FromRunner(runner).InstallInto(container);
     }
     else
     {
         runner = InstallInto(container);
     }
 }
Пример #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);
     }
 }
Пример #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));
        }
Пример #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;
     }
 }
Пример #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;
 }
Пример #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;
            }
        }
Пример #10
0
 public static BinsorRunnerInstaller FromRunner(AbstractConfigurationRunner runner)
 {
     return(new BinsorRunnerInstaller(runner));
 }
Пример #11
0
 public static BinsorRunnerInstaller FromRunner(AbstractConfigurationRunner runner)
 {
     return new BinsorRunnerInstaller(runner);
 }
Пример #12
0
 public static void Execute(IWindsorContainer container, AbstractConfigurationRunner abstractConfiguration)
 {
     Execute(container, () => abstractConfiguration.Run());
 }
Пример #13
0
 public static void Execute(IWindsorContainer container, AbstractConfigurationRunner abstractConfiguration)
 {
     Execute(container, () => abstractConfiguration.Run());
 }