The container supports the modules to load.

An example of the modules:

    public class MyModule : InjectorModule
    {
        #region Overrides of InjectorModule

        /// <summary>
        /// Load bindings in current module. 
        /// </summary>
        public override void Load()
        {
            Bind<IEmpty>().To<Empty>().InThreadScope();
        }

        #endregion
    }

     var injector = new MugenInjector(new MyModule());
     var empty = injector.Get<IEmpty>();
     injector.Unload("MyModule");
     try
     {
         injector.Get<IEmpty>();
     }
     catch (Exception)
     {
                
         Console.WriteLine("Is always true");
     }

Last edited Apr 5, 2012 at 2:14 PM by VVS0205, version 3

Comments

No comments yet.