<PackageReference Include="System.Reactive" Version="7.0.0-preview.1" />

CurrentPlatformEnlightenmentProvider

using System.ComponentModel; using System.Diagnostics; using System.Reactive.Concurrency; using System.Reactive.Linq; using System.Runtime.CompilerServices; namespace System.Reactive.PlatformServices { [EditorBrowsable(EditorBrowsableState.Never)] public class CurrentPlatformEnlightenmentProvider : IPlatformEnlightenmentProvider { [System.Runtime.CompilerServices.NullableContext(1)] [return: System.Runtime.CompilerServices.Nullable(2)] public virtual T GetService<T>(object[] args) where T : class { Type typeFromHandle = typeof(T); if (typeFromHandle == typeof(IExceptionServices)) return (T)(object)new System.Reactive.PlatformServices.ExceptionServicesImpl(); if (typeFromHandle == typeof(IConcurrencyAbstractionLayer)) return (T)(object)new System.Reactive.Concurrency.ConcurrencyAbstractionLayerImpl(); if (typeFromHandle == typeof(IScheduler) && args != null) { switch ((string)args[0]) { case "ThreadPool": return (T)(object)ThreadPoolScheduler.Instance; case "TaskPool": return (T)(object)TaskPoolScheduler.Default; case "NewThread": return (T)(object)NewThreadScheduler.Default; } } if (typeFromHandle == typeof(System.Reactive.Linq.IQueryServices) && Debugger.IsAttached) return (T)(object)new QueryDebugger(); return null; } } }