Utils.cs 667 B

1234567891011121314151617181920212223
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. using System.Linq;
  3. using System.Reactive.Subjects;
  4. using System.Reflection;
  5. using System.Runtime.Versioning;
  6. namespace ReactiveTests
  7. {
  8. static class Utils
  9. {
  10. public static bool IsRunningWithPortableLibraryBinaries()
  11. {
  12. #if DESKTOPCLR20
  13. return false;
  14. #else
  15. var a = typeof(ISubject<int>).GetTypeInfo().Assembly.GetCustomAttributes<TargetFrameworkAttribute>().SingleOrDefault();
  16. return a != null && a.FrameworkDisplayName == ".NET Portable Subset";
  17. #endif
  18. }
  19. }
  20. }