示例#1
0
        public static ICanConfigureCreatedObject <T> Register <T>(Func <IApplicationContext, T> objectCreation, string identifierName)
        {
            ICanContainConfiguration configurationParser = FluentStaticConfiguration.GetConfigurationParser(identifierName);

            if (configurationParser == null)
            {
                configurationParser = new ConstructorObjectDefinitionParser <T>(identifierName);
            }

            var objectBinder = new ConstructorObjectBinder <T>((ConstructorObjectDefinitionParser <T>)configurationParser);

            objectBinder.AddConstructorDelegate(objectCreation);

            FluentStaticConfiguration.RegisterObjectConfiguration(configurationParser);
            return(objectBinder);
        }
示例#2
0
 public ConstructorObjectBinder(ConstructorObjectDefinitionParser <T> configurationParser)
 {
     _configurationParser = configurationParser;
 }