Exemplo n.º 1
0
 public static void Rebind(
     this BasicIocContainer container,
     Type declarationType,
     object implementationObject)
 {
     container.RemoveBindings(declarationType);
     container.Bind(declarationType, implementationObject);
 }
Exemplo n.º 2
0
        public static T[] ResolveAll <T>(this BasicIocContainer container)
        {
            var resolutions      = container.ResolveAll(typeof(T));
            var typedResolutions = new T[resolutions.Length];

            Array.Copy(resolutions, typedResolutions, resolutions.Length);
            return(typedResolutions);
        }
Exemplo n.º 3
0
 public static void Rebind(
     this BasicIocContainer container,
     Type declarationType,
     Func <object> implementationFactory)
 {
     container.RemoveBindings(declarationType);
     container.Bind(declarationType, implementationFactory);
 }
Exemplo n.º 4
0
 public static BasicIocContainer Load(
     this BasicIocContainer container,
     Dictionary <Type, Type> bindings)
 {
     foreach (var binding in bindings)
     {
         container.Bind(binding.Key, binding.Value);
     }
     return(container);
 }