コード例 #1
0
 private void AddInstanceToInjector(ConstructableType blueprint, Type[] instanceTypes, object constructedInstance)
 {
     Injector.Add(instanceTypes, constructedInstance);
     if (blueprint.GetAttribute().Name != null)
     {
         Injector.Add(blueprint.GetAttribute().Name, constructedInstance);
     }
 }
コード例 #2
0
        private Type[] ConstructBlueprintAndGetTypesOfInstance(ConstructableType blueprint)
        {
            var instanceTypes = GetAllImplementingTypesForType(blueprint.Constructable);

            AddInstanceToInjector(blueprint, instanceTypes, blueprint.Construct(Injector));

            blueprints.Remove(blueprint);
            return(instanceTypes);
        }