GetChildNamespace() public method

public GetChildNamespace ( string name ) : NamespaceEntity
name string
return NamespaceEntity
Example #1
0
        public NamespaceEntity GetNamespace(string ns)
        {
            string[]        namespaceHierarchy = ns.Split('.');
            string          topLevelName       = namespaceHierarchy[0];
            NamespaceEntity topLevel           = GetTopLevelNamespace(topLevelName);
            NamespaceEntity current            = topLevel;

            for (int i = 1; i < namespaceHierarchy.Length; ++i)
            {
                current = current.GetChildNamespace(namespaceHierarchy[i]);
            }
            return(current);
        }