예제 #1
0
        private static INamespaceSymbol GetNamespace(string nspace, INamespaceSymbol namespaceSymbol)
        {
            namespaceSymbol = namespaceSymbol.GetNamespaceMembers()
                              .FirstOrDefault(ns =>
            {
                string fullNamespace = CodeAnalysisHelper.GetFullNamespace(ns);
                return(nspace == fullNamespace || nspace.StartsWith(fullNamespace + Type.Delimiter));
            });

            if (namespaceSymbol != null && CodeAnalysisHelper.GetFullNamespace(namespaceSymbol) != nspace)
            {
                namespaceSymbol = CodeAnalysisHelper.GetNamespace(nspace, namespaceSymbol);
            }

            return(namespaceSymbol);
        }
예제 #2
0
 public static INamespaceSymbol GetNamespace(string nspace, Compilation compilation)
 {
     return(CodeAnalysisHelper.GetNamespace(nspace, compilation.GlobalNamespace));
 }