Guest User

Untitled

a guest
Jun 22nd, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. public static void Main(string[] args)
  2. {
  3. printAllPublicPropertiesInCurrentAppDomain(typeof(string));
  4. }
  5.  
  6. private static void printAllPublicPropertiesInCurrentAppDomain(Type typeToFind)
  7. {
  8. foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
  9. {
  10. foreach (Type type in assembly.GetTypes())
  11. {
  12. foreach (PropertyInfo info in type.GetProperties())
  13. {
  14. if (info.PropertyType == typeToFind)
  15. {
  16. Console.WriteLine("Assembly: {0}, Type: {1}, Property: {2}", assembly.GetName().Name, type.Name, info.Name);
  17. }
  18. }
  19. }
  20. }
  21. }
  22.  
  23. type.GetProperties(BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic)
Add Comment
Please, Sign In to add comment