public override void OnUsing(AppModuleUsingArguments args)
        {
            AutofacContainerBuilder builder = args.AppSetup.GetAppContainerBuilder <AutofacContainerBuilder>();

            builder.Building += Builder_Building;

            ConfigAppContainerBuilder configBuilder = args.AppSetup.GetAppContainerBuilder <ConfigAppContainerBuilder>();

            configBuilder.ConfigObjectRegisted += ConfigBuilder_ConfigObjectRegisted;
        }
コード例 #2
0
        public override void OnUsing(AppModuleUsingArguments arguments)
        {
            var setup        = arguments.AppSetup;
            var targetModule = arguments.TargetAppModule;

            ConfigAppContainerBuilder builder = setup.GetAppContainerBuilder <ConfigAppContainerBuilder>();

            arguments.ScannedAttributeAndTypeInfos
            .Where(x => x.Attribute is ConfigAttribute)
            .ForEach(x => builder.AutoConfig(x));
        }
コード例 #3
0
        public void Handle(AppSetup appSetup, IAppModule appModule, MethodInfo method, Attribute attribute)
        {
            if (method.ReturnType == typeof(void))
            {
                return;
            }

            ConfigAppContainerBuilder builder = appSetup.GetAppContainerBuilder <ConfigAppContainerBuilder>();

            ConfigCreatorAttribute config = (ConfigCreatorAttribute)attribute;

            builder.AddConfig(appModule, method);
        }