Пример #1
0
        private static bool TypeHasInterfaceInSet(INamedTypeSymbol type, SymbolSet set)
        {
            foreach (var interfaceType in type.Interfaces)
            {
                if (set.Contains(interfaceType.OriginalDefinition))
                {
                    return(true);
                }
            }

            return(false);
        }
Пример #2
0
        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>());
        }
Пример #3
0
        private static bool TypeHasBaseTypeInSet(INamedTypeSymbol type, SymbolSet set)
        {
            var baseType = type.BaseType?.OriginalDefinition;

            return(baseType != null && set.Contains(baseType));
        }