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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -