Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

PropertyInfoExtensions.cs 496B

123456789101112131415161718192021222324
  1. using System;
  2. using System.Reflection;
  3. public static class NetFXCoreWrappers
  4. {
  5. public static MethodInfo GetMethodInfoEx(this Delegate delegateEx)
  6. {
  7. #if NETFX_CORE
  8. var method = delegateEx.GetMethodInfo();
  9. #else
  10. var method = delegateEx.Method;
  11. #endif
  12. return method;
  13. }
  14. public static Type GetDeclaringType(this MethodInfo methodInfo)
  15. {
  16. #if NETFX_CORE
  17. return methodInfo.DeclaringType;
  18. #else
  19. return methodInfo.ReflectedType;
  20. #endif
  21. }
  22. }