AgentMulder.Containers.Ninject.Patterns.Bind.To.ToNonGeneric.GetComponentRegistrations C# (CSharp) Method

GetComponentRegistrations() public method

public GetComponentRegistrations ( ITreeNode registrationRootElement ) : IEnumerable
registrationRootElement ITreeNode
return IEnumerable
        public override IEnumerable<IComponentRegistration> GetComponentRegistrations(ITreeNode registrationRootElement)
        {
            IStructuralMatchResult match = Match(registrationRootElement);

            if (match.Matched)
            {
                var argument = match.GetMatchedElement(ElementName) as ICSharpArgument;
                if (argument == null)
                {
                    yield break;
                }

                // match typeof() expressions
                var typeOfExpression = argument.Value as ITypeofExpression;
                if (typeOfExpression != null)
                {
                    var typeElement = ((IDeclaredType)typeOfExpression.ArgumentType).GetTypeElement();
                    if (typeElement == null) // can happen if the typeof() expression is empty
                    {
                        yield break;
                    }

                    yield return new ComponentRegistration(registrationRootElement, typeElement);
                }
            }
        }