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

silverlight - Applying a style to ItemContainerStyle in C# -

php - Posting PHPBB Forum Thread/Post info in a website -

drupal - using views argument in the view tpl.php file -