Src/Black.Beard.ComponentModel/ComponentModel/TypeDiscovery.cs
/// <summary>
/// return a list of type that contains specified attibute
/// </summary>
/// <param name="attributeTypeFilter"></param>
/// <returns></returns>
return a list of type that contains specified attibute
return a list of type that contains specified attibute
public List<Type> GetTypesWithAttributes(Type attributeTypeFilter)
        {
            if (attributeTypeFilter == null)
                attributeTypeFilter = typeof(Attribute);
            var result = new List<Type>();
            var assemblies = Assemblies().ToArray();
            result.AddRange(Collect(type =>
            {
                return ToList(TypeDescriptor.GetAttributes(type)).Any(c => c.GetType() == attributeTypeFilter);
            }, assemblies));
            return result;
        }
public List < Type > GetTypesWithAttributes ( Type attributeTypeFilter ) { if ( attributeTypeFilter == null ) attributeTypeFilter = typeof ( Attribute ) ; var result = new List < Type > ( ) ; var assemblies = Assemblies ( ) . ToArray ( ) ; result . AddRange ( Collect ( type => { return ToList ( TypeDescriptor . GetAttributes ( type ) ) . Any ( c => c . GetType ( ) == attributeTypeFilter ) ; } , assemblies ) ) ; return result ; }
return a list of type that contains specified attibute
return a list of type that contains specified attibute
None
attributeTypeFilter
Type
None