PageRenderTime 172ms CodeModel.GetById 80ms app.highlight 1ms RepoModel.GetById 90ms app.codeStats 0ms

/src/LinFu.IoC/Configuration/InitializerPlugin.cs

http://github.com/philiplaureano/LinFu
C# | 31 lines | 15 code | 2 blank | 14 comment | 0 complexity | 3f623ad9235d1dcf1eee755614297cc2 MD5 | raw file
 1using LinFu.IoC.Interfaces;
 2using LinFu.Reflection;
 3
 4namespace LinFu.IoC.Configuration
 5{
 6    /// <summary>
 7    ///     A class that injects the <see cref="Initializer" /> postprocessor
 8    ///     into every container that is created or loaded.
 9    /// </summary>
10    public class InitializerPlugin : ILoaderPlugin<IServiceContainer>
11    {
12        /// <summary>
13        ///     This override does absolutely nothing.
14        /// </summary>
15        /// <param name="target">The target container.</param>
16        public void BeginLoad(IServiceContainer target)
17        {
18            // Do nothing
19        }
20
21        /// <summary>
22        ///     Injects the <see cref="Initializer" /> postprocessor into
23        ///     the container.
24        /// </summary>
25        /// <param name="target"></param>
26        public void EndLoad(IServiceContainer target)
27        {
28            target.PostProcessors.Add(new Initializer());
29        }
30    }
31}