NetFxExtensions.cs 404 B

1234567891011121314151617181920212223242526272829303132
  1. 
  2. #if NETFX_CORE
  3. using System;
  4. using System.Reflection;
  5. namespace SRF
  6. {
  7. public static class NetFxExtensions
  8. {
  9. public static bool IsAssignableFrom(this Type @this, Type t)
  10. {
  11. return @this.GetTypeInfo().IsAssignableFrom(t.GetTypeInfo());
  12. }
  13. public static bool IsInstanceOfType(this Type @this, object obj)
  14. {
  15. return @this.IsAssignableFrom(obj.GetType());
  16. }
  17. }
  18. }
  19. #endif