/WorldView/Utilities/Util.cs

# · C# · 24 lines · 22 code · 2 blank · 0 comment · 2 complexity · e9041d67bfd3ff7ba2debdcb9ab025b8 MD5 · raw file

  1. using System;
  2. using System.Reflection;
  3. namespace MoreTerra.Utilities
  4. {
  5. public static class Util
  6. {
  7. public static Type GetResourceAssemblyType()
  8. {
  9. foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies())
  10. {
  11. foreach (Type t in assembly.GetTypes())
  12. {
  13. if (t.Name == "Resources")
  14. {
  15. return t;
  16. }
  17. }
  18. }
  19. throw new ApplicationException("Cannot find the Resource Assembly");
  20. }
  21. }
  22. }