예제 #1
0
 public static void Rebind(
     this BasicIocContainer container,
     Type declarationType,
     object implementationObject)
 {
     container.RemoveBindings(declarationType);
     container.Bind(declarationType, implementationObject);
 }
예제 #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);
        }
예제 #3
0
 public static void Rebind(
     this BasicIocContainer container,
     Type declarationType,
     Func <object> implementationFactory)
 {
     container.RemoveBindings(declarationType);
     container.Bind(declarationType, implementationFactory);
 }
예제 #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);
 }