private static IEnumerable <ISymbol> GetAllSymbolsWorker(SymbolKeyResolution resolution) { if (resolution.Symbol != null) { yield return(resolution.Symbol); } foreach (var symbol in resolution.CandidateSymbols) { yield return(symbol); } }
public static ISymbol GetAnySymbol(this SymbolKeyResolution resolution) { if (resolution.Symbol != null) { return(resolution.Symbol); } if (resolution.CandidateSymbols.Length > 0) { return(resolution.CandidateSymbols[0]); } return(null); }
public static IEnumerable <ISymbol> GetAllSymbols(this SymbolKeyResolution resolution) { return(GetAllSymbolsWorker(resolution).Distinct()); }