public override void VisitNamespaceDeclaration(NamespaceDeclarationSyntax node) { // Ensure that a CCNamespace is created for this namespace string namespaceName = GetNamespaceName(node); CCNamespace ns = codeModel.EnsureNamespace(namespaceName); // Collect distinct usings from inside the namespace declaration and from the surrounding compilation unit. CompilationUnitSyntax cunit = GetCompilationUnit(node); HashSet <string> usings = new HashSet <string>(); foreach (var u in node.Usings) { usings.Add(u.Name.ToString()); } foreach (var u in cunit.Usings) { usings.Add(u.Name.ToString()); } // Increment outgoing dependencies of the current namespace declaration ns.OutgoingDependencies += usings.Count; // Increment incoming depedencies for each referenced namespace. foreach (var uname in usings) { CCNamespace d = codeModel.EnsureNamespace(uname); d.IncomingDependencies++; } base.VisitNamespaceDeclaration(node); }