コード例 #1
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);
         }
     }
 }
コード例 #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
ファイル: SymbolKey.cs プロジェクト: singhsarab/roslyn
 private static TSymbol GetFirstSymbol <TSymbol>(SymbolKeyResolution resolution)
     where TSymbol : ISymbol
 {
     return(resolution.GetAllSymbols().OfType <TSymbol>().FirstOrDefault());
 }