private void Visit(NamespaceDescription ns, List <List <string> > usings, List <IDeclContainer> returner)
        {
            bool          prefix    = false;
            bool          match     = false;
            List <string> currentNS = ns.GetFullNamespace();

            foreach (List <string> list in usings)
            {
                if (Util.NamespacePrefix(currentNS, list))
                {
                    prefix = true;
                    if (Util.NamespacesEquals(currentNS, list))
                    {
                        match = true;
                        break;
                    }
                }
            }
            if (match)
            {
                returner.Add(ns);
            }
            if (prefix)
            {
                foreach (NamespaceDescription namespaceDescription in ns.Namespaces)
                {
                    Visit(namespaceDescription, usings, returner);
                }
            }
        }
        public override bool Equals(object obj)
        {
            if (!(obj is NamespaceDescription))
            {
                return(false);
            }
            NamespaceDescription other = (NamespaceDescription)obj;

            if (decl.GetName().Text != other.decl.GetName().Text)
            {
                return(false);
            }

            if (Methods.Count != other.Methods.Count ||
                Fields.Count != other.Fields.Count ||
                Structs.Count != other.Structs.Count ||
                Enrichments.Count != other.Enrichments.Count ||
                Usings.Count != other.Usings.Count ||
                Typedefs.Count != other.Typedefs.Count ||
                Namespaces.Count != other.Namespaces.Count)
            {
                return(false);
            }

            return(!(Methods.Where((t, i) => !t.Equals(other.Methods[i])).Any() ||
                     Fields.Where((t, i) => !t.Equals(other.Fields[i])).Any() ||
                     Structs.Where((t, i) => !t.Equals(other.Structs[i])).Any() ||
                     Enrichments.Where((t, i) => !t.Equals(other.Enrichments[i])).Any() ||
                     Usings.Where((t, i) => t != other.Usings[i]).Any() ||
                     Typedefs.Where((t, i) => !t.Equals(other.Typedefs[i])).Any() ||
                     Namespaces.Where((t, i) => !t.Equals(other.Namespaces[i])).Any()));
        }
 private void Visit(NamespaceDescription ns, List <IDeclContainer> returner)
 {
     returner.Add(ns);
     foreach (NamespaceDescription namespaceDescription in ns.Namespaces)
     {
         Visit(namespaceDescription, returner);
     }
 }
            public override void CaseANamespaceDecl(ANamespaceDecl node)
            {
                if (isFirst)
                {
                    base.CaseANamespaceDecl(node);
                    return;
                }
                NamespaceDescription ns = new NamespaceDescription(node);

                Namespaces.Add(ns);
            }
 public override void CaseANamespaceDecl(ANamespaceDecl node)
 {
     if (isFirst)
     {
         base.CaseANamespaceDecl(node);
         return;
     }
     NamespaceDescription ns = new NamespaceDescription(node);
     Namespaces.Add(ns);
 }
 private void Visit(NamespaceDescription ns, List<List<string>> usings, List<IDeclContainer> returner)
 {
     bool prefix = false;
     bool match = false;
     List<string> currentNS = ns.GetFullNamespace();
     foreach (List<string> list in usings)
     {
         if (Util.NamespacePrefix(currentNS, list))
         {
             prefix = true;
             if (Util.NamespacesEquals(currentNS, list))
             {
                 match = true;
                 break;
             }
         }
     }
     if (match)
         returner.Add(ns);
     if (prefix)
     {
         foreach (NamespaceDescription namespaceDescription in ns.Namespaces)
         {
             Visit(namespaceDescription, usings, returner);
         }
     }
 }
 private void Visit(NamespaceDescription ns, List<IDeclContainer> returner)
 {
     returner.Add(ns);
     foreach (NamespaceDescription namespaceDescription in ns.Namespaces)
     {
         Visit(namespaceDescription, returner);
     }
 }