예제 #1
0
        private static IEnumerable<string> EnumerateNamespaces(NamespaceSymbol @namespace, string baseName)
        {
            foreach (var child in @namespace.GetNamespaceMembers())
            {
                var childName = string.IsNullOrEmpty(baseName) ? child.Name : (baseName + "." + child.Name);
                yield return childName;

                foreach (var result in EnumerateNamespaces(child, childName))
                {
                    yield return result;
                }
            }
        }
예제 #2
0
 /// <summary>
 /// </summary>
 /// <param name="source">
 /// </param>
 /// <returns>
 /// </returns>
 private static IEnumerable<NamespaceSymbol> GetAllNamespaces(NamespaceSymbol source)
 {
     yield return source;
     foreach (var namespaceSymbolSub in source.GetNamespaceMembers().SelectMany(namespaceSymbolSub => GetAllNamespaces(namespaceSymbolSub)))
     {
         yield return namespaceSymbolSub;
     }
 }