c# - All built-in .Net attributes -
i have used appdomain.currentdomain.getassemblies()
list assemblies, how list built-in attributes in .net 2.0 using c#?
note appdomain.getassemblies()
list loaded assemblies... it's easy:
var attributes = assembly in assemblies type in assembly.gettypes() typeof(attribute).isassignablefrom(type) select type;
.net 2.0 (non-linq) version:
list<type> attributes = new list<type>(); foreach (assembly assembly in appdomain.currentdomain.getassemblies()) { foreach (type type in assembly.gettypes()) { if (typeof(attribute).isassignablefrom(type)) { attributes.add(type); } } }
Comments
Post a Comment