Boo.Lang.Compiler.TypeSystem.Generics.GenericsServices.FindConstructedTypes C# (CSharp) Метод

FindConstructedTypes() публичный статический Метод

Finds types constructed from the specified definition in the specified type's interfaces and base types.
public static FindConstructedTypes ( IType type, IType definition ) : IEnumerable
type IType The type in whose hierarchy to search for constructed types.
definition IType The generic type definition whose constructed versions to search for.
Результат IEnumerable
        public static IEnumerable<IType> FindConstructedTypes(IType type, IType definition)
        {
            while (type != null)
            {
                if (type.ConstructedInfo != null &&
                    type.ConstructedInfo.GenericDefinition == definition)
                {
                    yield return type;
                }

                IType[] interfaces = type.GetInterfaces();
                if (interfaces != null)
                {
                    foreach (IType interfaceType in interfaces)
                    {
                        foreach (IType match in FindConstructedTypes(interfaceType, definition))
                        {
                            yield return match;
                        }
                    }
                }

                type = type.BaseType;
            }
        }