コード例 #1
0
            private Location CreateModuleLocation(
                SymbolKeyResolution assembly, string moduleName)
            {
                var symbol = assembly.GetAnySymbol() as IAssemblySymbol;

                Debug.Assert(symbol != null);
                var module = symbol.Modules.FirstOrDefault(m => m.MetadataName == moduleName);

                return(module.Locations.FirstOrDefault());
            }
コード例 #2
0
 private static IEnumerable<INamedTypeSymbol> ResolveErrorTypes(
     SymbolKeyReader reader,
     SymbolKeyResolution containingSymbolResolution, string name, int arity)
 {
     if (containingSymbolResolution.GetAnySymbol() == null)
     {
         yield return reader.Compilation.CreateErrorTypeSymbol(null, name, arity);
     }
     else
     {
         foreach (var container in containingSymbolResolution.GetAllSymbols().OfType<INamespaceOrTypeSymbol>())
         {
             yield return reader.Compilation.CreateErrorTypeSymbol(container, name, arity);
         }
     }
 }
コード例 #3
0
 private static IEnumerable <INamedTypeSymbol> ResolveErrorTypes(
     SymbolKeyReader reader,
     SymbolKeyResolution containingSymbolResolution, string name, int arity)
 {
     if (containingSymbolResolution.GetAnySymbol() == null)
     {
         yield return(reader.Compilation.CreateErrorTypeSymbol(null, name, arity));
     }
     else
     {
         foreach (var container in containingSymbolResolution.GetAllSymbols().OfType <INamespaceOrTypeSymbol>())
         {
             yield return(reader.Compilation.CreateErrorTypeSymbol(container, name, arity));
         }
     }
 }