AgentMulder.Containers.StructureMap.Patterns.Scan.IncludeNamespaceContainingType.GetNamespaceElement C# (CSharp) Method

GetNamespaceElement() protected method

protected GetNamespaceElement ( IStructuralMatchResult match, bool &includeSubnamespaces ) : INamespace
match IStructuralMatchResult
includeSubnamespaces bool
return INamespace
        protected override INamespace GetNamespaceElement(IStructuralMatchResult match, out bool includeSubnamespaces)
        {
            includeSubnamespaces = true;

            var declaredType = match.GetMatchedType("type") as IDeclaredType;
            if (declaredType != null)
            {
                ITypeElement typeElement = declaredType.GetTypeElement();
                if (typeElement != null)
                {
                    return typeElement.GetContainingNamespace();
                }
            }

            return null;
        }