private static bool TypeHasInterfaceInSet(INamedTypeSymbol type, SymbolSet set) { foreach (var interfaceType in type.Interfaces) { if (set.Contains(interfaceType.OriginalDefinition)) { return(true); } } return(false); }
public IEnumerable <Option> BuildOptions() { var optionSet = new SymbolSet(); foreach (var parameter in _constructorBinder.BuildOptions()) { optionSet.Add(parameter); } foreach (var property in GetSettableProperties() .OmitInfrastructureTypes()) { var option = property.BuildOption(); if (!optionSet.Contains(option.Name)) { optionSet.Add(option); } } return(optionSet.Cast <Option>()); }
private static bool TypeHasBaseTypeInSet(INamedTypeSymbol type, SymbolSet set) { var baseType = type.BaseType?.OriginalDefinition; return(baseType != null && set.Contains(baseType)); }