Stubs.cs 891 B

123456789101112131415161718192021222324252627
  1. // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
  2. namespace System.Reactive
  3. {
  4. internal static class Stubs<T>
  5. {
  6. public static readonly Action<T> Ignore = _ => { };
  7. public static readonly Func<T, T> I = _ => _;
  8. }
  9. internal static class Stubs
  10. {
  11. public static readonly Action Nop = () => { };
  12. public static readonly Action<Exception> Throw = ex => { ex.Throw(); };
  13. }
  14. #if !NO_THREAD
  15. internal static class TimerStubs
  16. {
  17. #if NETCOREAPP1_0
  18. public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { }, null, System.Threading.Timeout.Infinite, System.Threading.Timeout.Infinite);
  19. #else
  20. public static readonly System.Threading.Timer Never = new System.Threading.Timer(_ => { });
  21. #endif
  22. }
  23. #endif
  24. }