AgentMulder.Containers.Autofac.Patterns.FromAssemblies.RegisterAssemblyTypes.GetComponentRegistrations C# (CSharp) Метод

GetComponentRegistrations() публичный Метод

public GetComponentRegistrations ( ITreeNode registrationRootElement ) : IEnumerable
registrationRootElement ITreeNode
Результат IEnumerable
        public override IEnumerable<IComponentRegistration> GetComponentRegistrations(ITreeNode registrationRootElement)
        {
            IExpressionStatement parentExpression = GetParentExpressionStatement(registrationRootElement);
            if (parentExpression == null)
            {
                yield break;
            }

            IStructuralMatchResult match = Match(registrationRootElement);
            if (match.Matched)
            {
                var arguments = match.GetMatchedElementList("assemblies").Cast<ICSharpArgument>();

                IEnumerable<IModule> modules = arguments.SelectNotNull(argument => ModuleExtractor.GetTargetModule(argument.Value));

                IEnumerable<FilteredRegistrationBase> basedOnRegistrations = basedOnPatterns.SelectMany(
                    basedOnPattern => basedOnPattern.GetBasedOnRegistrations(parentExpression.Expression)).ToList();

                foreach (IModule module in modules)
                {
                    // todo blech, fix this
                    yield return new CompositeRegistration(registrationRootElement, basedOnRegistrations.Concat(
                        new ComponentRegistrationBase[]
                        {
                            new DefaultScanAssemblyRegistration(registrationRootElement),
                            new ModuleBasedOnRegistration(registrationRootElement, module)
                        }));
                }
            }
        }