Explorar el Código

WIP going back to old types, relocated

Ian Griffiths hace 7 meses
padre
commit
2fc0d41012
Se han modificado 31 ficheros con 151 adiciones y 2297 borrados
  1. 0 227
      Rx.NET/Source/facades/System.Reactive/Obsolete/Desktop/Concurrency/ControlScheduler.cs
  2. 0 114
      Rx.NET/Source/facades/System.Reactive/Obsolete/Desktop/Linq/ControlObservable.cs
  3. 0 275
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Concurrency/CoreDispatcherScheduler.cs
  4. 1 2
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Concurrency/ThreadPoolScheduler.Windows.cs
  5. 0 37
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/EventPatternSource.cs
  6. 0 293
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Foundation/AsyncInfoExtensions.cs
  7. 0 122
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Foundation/AsyncInfoToObservableBridge.cs
  8. 0 83
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/IEventPatternSource.cs
  9. 0 309
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/AsyncInfoObservable.cs
  10. 0 406
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/CoreDispatcherObservable.cs
  11. 0 190
      Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/WindowsObservable.Events.cs
  12. 21 3
      Rx.NET/Source/facades/System.Reactive/System.Reactive.csproj
  13. 5 1
      Rx.NET/Source/facades/System.Reactive/System/Reactive.cs
  14. 7 7
      Rx.NET/Source/facades/System.Reactive/System/Reactive/Concurrency.cs
  15. 9 8
      Rx.NET/Source/facades/System.Reactive/System/Reactive/Linq.cs
  16. 6 6
      Rx.NET/Source/facades/System.Reactive/System/Reactive/Windows/Foundation.cs
  17. 2 3
      Rx.NET/Source/src/System.Reactive.For.WindowsForms/ControlScheduler.cs
  18. 5 13
      Rx.NET/Source/src/System.Reactive.For.WindowsForms/System.Reactive.Linq/ControlObservable.cs
  19. 5 1
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/AsyncInfoObservableExtensions.cs
  20. 12 8
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/CoreDispatcherScheduler.cs
  21. 3 3
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/EventPatternSource.cs
  22. 24 0
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/IEventPatternSource.cs
  23. 1 1
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/StableCompositeDisposable.cs
  24. 13 12
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/AsyncInfoObservable.cs
  25. 24 23
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/CoreDispatcherObservable.cs
  26. 9 5
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsObservable.Events.cs
  27. 1 7
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsObservable.StandardSequenceOperators.cs
  28. 0 135
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsRuntimeObservable.StandardSequenceOperators.cs
  29. 1 3
      Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/ThreadPoolTimerExtensions.cs
  30. 1 0
      Rx.NET/Source/src/System.Reactive.Net/Properties/InternalsVisibleTo.cs
  31. 1 0
      Rx.NET/Source/src/System.Reactive.Net/System.Reactive.Net.csproj

+ 0 - 227
Rx.NET/Source/facades/System.Reactive/Obsolete/Desktop/Concurrency/ControlScheduler.cs

@@ -1,227 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information.
-
-#if HAS_WINFORMS
-extern alias SystemReactiveNet;
-
-using SystemReactiveNet::System.Reactive.Concurrency;
-using SystemReactiveNet::System.Reactive.Disposables;
-using System.Reactive.Linq;
-using System.Threading;
-using System.Windows.Forms;
-
-namespace System.Reactive.Concurrency
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsForms</c> NuGet package defines a
-    /// <c>ControlScheduler</c> class in the <c>System.Reactive.WindowsForms</c>
-    /// namespace that replaces this class.
-    /// </summary>
-    /// <remarks>
-    /// This will eventually be removed because all UI-framework-specific functionality is being
-    /// removed from <c>System.Reactive</c>. This is necessary to fix problems in which
-    /// <c>System.Reactive</c> causes applications to end up with dependencies on Windows Forms and
-    /// WPF whether they want them or not.
-    /// </remarks>
-    [Obsolete("Use System.Reactive.WindowsForms.ControlScheduler in the System.Reactive.For.WindowsForms package instead", error: false)]
-    public class ControlScheduler : LocalScheduler, ISchedulerPeriodic
-    {
-        private readonly Control _control;
-
-        /// <summary>
-        /// Constructs a ControlScheduler that schedules units of work on the message loop associated with the specified Windows Forms control.
-        /// </summary>
-        /// <param name="control">Windows Forms control to get the message loop from.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="control"/> is null.</exception>
-        /// <remarks>
-        /// This scheduler type is typically used indirectly through the <see cref="ControlObservable.ObserveOn{TSource}"/> and <see cref="Linq.ControlObservable.SubscribeOn{TSource}"/> method overloads that take a Windows Forms control.
-        /// </remarks>
-        public ControlScheduler(Control control)
-        {
-            _control = control ?? throw new ArgumentNullException(nameof(control));
-        }
-
-        /// <summary>
-        /// Gets the control associated with the ControlScheduler.
-        /// </summary>
-        public Control Control => _control;
-
-        /// <summary>
-        /// Schedules an action to be executed on the message loop associated with the control.
-        /// </summary>
-        /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
-        /// <param name="state">State passed to the action to be executed.</param>
-        /// <param name="action">Action to be executed.</param>
-        /// <returns>The disposable object used to cancel the scheduled action (best effort).</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="action"/> is null.</exception>
-        public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
-        {
-            if (action == null)
-            {
-                throw new ArgumentNullException(nameof(action));
-            }
-
-            if (_control.IsDisposed)
-            {
-                return Disposable.Empty;
-            }
-
-            var d = new SingleAssignmentDisposable();
-
-            _control.BeginInvoke(new Action(() =>
-            {
-                if (!_control.IsDisposed && !d.IsDisposed)
-                {
-                    d.Disposable = action(this, state);
-                }
-            }));
-
-            return d;
-        }
-
-        /// <summary>
-        /// Schedules an action to be executed after dueTime on the message loop associated with the control, using a Windows Forms Timer object.
-        /// </summary>
-        /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
-        /// <param name="state">State passed to the action to be executed.</param>
-        /// <param name="action">Action to be executed.</param>
-        /// <param name="dueTime">Relative time after which to execute the action.</param>
-        /// <returns>The disposable object used to cancel the scheduled action (best effort).</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="action"/> is null.</exception>
-        public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
-        {
-            if (action == null)
-            {
-                throw new ArgumentNullException(nameof(action));
-            }
-
-            var dt = Scheduler.Normalize(dueTime);
-            if (dt.Ticks == 0)
-            {
-                return Schedule(state, action);
-            }
-
-            var createTimer = new Func<IScheduler, TState, IDisposable>((scheduler1, state1) =>
-            {
-                var d = new MultipleAssignmentDisposable();
-
-                var timer = new System.Windows.Forms.Timer();
-
-                timer.Tick += (s, e) =>
-                {
-                    var t = Interlocked.Exchange(ref timer, null);
-                    if (t != null)
-                    {
-                        try
-                        {
-                            if (!_control.IsDisposed && !d.IsDisposed)
-                            {
-                                d.Disposable = action(scheduler1, state1);
-                            }
-                        }
-                        finally
-                        {
-                            t.Stop();
-                            action = static (s, t) => Disposable.Empty;
-                        }
-                    }
-                };
-
-                timer.Interval = (int)dt.TotalMilliseconds;
-                timer.Start();
-
-                d.Disposable = Disposable.Create(() =>
-                {
-                    var t = Interlocked.Exchange(ref timer, null);
-                    if (t != null)
-                    {
-                        t.Stop();
-                        action = static (s, t) => Disposable.Empty;
-                    }
-                });
-
-                return d;
-            });
-
-            //
-            // This check is critical. When creating and enabling a Timer object on another thread than
-            // the UI thread, it won't fire.
-            //
-            if (_control.InvokeRequired)
-            {
-                return Schedule(state, createTimer);
-            }
-            else
-            {
-                return createTimer(this, state);
-            }
-        }
-
-        /// <summary>
-        /// Schedules a periodic piece of work on the message loop associated with the control, using a Windows Forms Timer object.
-        /// </summary>
-        /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
-        /// <param name="state">Initial state passed to the action upon the first iteration.</param>
-        /// <param name="period">Period for running the work periodically.</param>
-        /// <param name="action">Action to be executed, potentially updating the state.</param>
-        /// <returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="action"/> is null.</exception>
-        /// <exception cref="ArgumentOutOfRangeException"><paramref name="period"/> is less than one millisecond.</exception>
-        public IDisposable SchedulePeriodic<TState>(TState state, TimeSpan period, Func<TState, TState> action)
-        {
-            //
-            // Threshold derived from Interval property setter in ndp\fx\src\winforms\managed\system\winforms\Timer.cs.
-            //
-            if (period.TotalMilliseconds < 1)
-            {
-                throw new ArgumentOutOfRangeException(nameof(period));
-            }
-
-            if (action == null)
-            {
-                throw new ArgumentNullException(nameof(action));
-            }
-
-            var createTimer = new Func<IScheduler, TState, IDisposable>((scheduler1, state1) =>
-            {
-                var timer = new System.Windows.Forms.Timer();
-
-                timer.Tick += (s, e) =>
-                {
-                    if (!_control.IsDisposed)
-                    {
-                        state1 = action(state1);
-                    }
-                };
-
-                timer.Interval = (int)period.TotalMilliseconds;
-                timer.Start();
-
-                return Disposable.Create(() =>
-                {
-                    var t = Interlocked.Exchange(ref timer, null);
-                    if (t != null)
-                    {
-                        t.Stop();
-                        action = static _ => _;
-                    }
-                });
-            });
-
-            //
-            // This check is critical. When creating and enabling a Timer object on another thread than
-            // the UI thread, it won't fire.
-            //
-            if (_control.InvokeRequired)
-            {
-                return Schedule(state, createTimer);
-            }
-            else
-            {
-                return createTimer(this, state);
-            }
-        }
-    }
-}
-#endif

+ 0 - 114
Rx.NET/Source/facades/System.Reactive/Obsolete/Desktop/Linq/ControlObservable.cs

@@ -1,114 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINFORMS
-extern alias SystemReactiveNet;
-
-using System.Reactive.Concurrency;
-using SystemReactiveNet::System.Reactive.Concurrency;
-using SystemReactiveNet::System.Reactive.Linq;
-using System.Windows.Forms;
-
-namespace System.Reactive.Linq
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsForms</c> NuGet package defines a
-    /// <c>WindowsFormsControlObservable</c> class that defines new extension methods to be used in
-    /// place of these (also in the <c>System.Reactive.Linq</c> namespace).
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// The replacement <c>WindowsFormsControlObservable</c> class uses different names for extension
-    /// methods. When you migrate to that new class from this obsolete one, you will need to change
-    /// your code to invoke different method names:
-    /// </para>
-    /// <list type="table">
-    ///     <listheader><term>Rx &lt;= 6.0</term><term>Now</term></listheader>
-    ///     <item>
-    ///         <term><c>ObserveOn</c></term>
-    ///         <term><c>ObserveOnWindowsFormsControl</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>SubscribeOn</c></term>
-    ///         <term><c>SubscribeOnWindowFormsControl</c></term>
-    ///     </item>
-    /// </list>
-    /// <para>
-    /// This will eventually be removed because all UI-framework-specific functionality is being
-    /// removed from <c>System.Reactive</c>. This is necessary to fix problems in which
-    /// <c>System.Reactive</c> causes applications to end up with dependencies on Windows Forms and
-    /// WPF whether they want them or not.
-    /// </para>
-    /// <para>
-    /// Rx defines extension methods for <see cref="IObservable{T}"/> in either the
-    /// <c>System.Reactive.Linq</c> or <c>System</c> namespaces. This means the replacement for
-    /// this obsolete class has to use different names. We need to retain these old obsolete
-    /// extension methods for many years to provide code using Rx with time to adapt, which means
-    /// the new extension methods must coexist with these old obsolete ones. Extension methods
-    /// are awkward to fully qualify, making it easier for migrating code if the new methods have
-    /// visibly different names (and not the same names on a new type).
-    /// </para>
-    /// </remarks>
-    [Obsolete("Use the extension methods defined by the System.Reactive.Linq.WindowsFormsControlObservable class in the System.Reactive.For.WindowsForms package instead", error: false)]
-
-    public static class ControlObservable
-    {
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnWindowFormsControl</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsFormsControlObservable</c> in the
-        /// <c>System.Reactive.For.WindowsForms</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="control">Windows Forms control whose associated message loop is used to perform subscription and unsubscription actions on.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the Windows Forms message loop associated with the specified control.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="control"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified control.
-        /// In order to invoke observer callbacks on the specified control, e.g. to render results in a control, use <see cref="ObserveOn"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnWindowFormsControl extension method defined by System.Reactive.Linq.WindowsFormsControlObservable in the System.Reactive.For.WindowsForms package instead", error: false)]
-        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Control control)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (control == null)
-            {
-                throw new ArgumentNullException(nameof(control));
-            }
-
-            return Synchronization.SubscribeOn(source, new ControlScheduler(control));
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnWindowsFormsControl</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsFormsControlObservable</c> in the
-        /// <c>System.Reactive.For.WindowsForms</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="control">Windows Forms control whose associated message loop is used to notify observers on.</param>
-        /// <returns>The source sequence whose observations happen on the Windows Forms message loop associated with the specified control.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="control"/> is null.</exception>
-        [Obsolete("Use the ObserveOnWindowsFormsControl extension method defined by System.Reactive.Linq.WindowsFormsControlObservable in the System.Reactive.For.WindowsForms package instead", error: false)]
-        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, Control control)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (control == null)
-            {
-                throw new ArgumentNullException(nameof(control));
-            }
-
-            return Synchronization.ObserveOn(source, new ControlScheduler(control));
-        }
-    }
-}
-#endif

+ 0 - 275
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Concurrency/CoreDispatcherScheduler.cs

@@ -1,275 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if WINDOWS
-extern alias SystemReactiveNet;
-
-using SystemReactiveNet::System.Reactive.Disposables;
-using SystemReactiveNet::System.Reactive.Concurrency;
-using System.Runtime.ExceptionServices;
-using System.Threading;
-using Windows.System;
-using Windows.UI.Core;
-
-namespace System.Reactive.Concurrency
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsRuntime</c> NuGet package defines a
-    /// <c>CoreDispatcherScheduler</c> class in the <c>System.Reactive.WindowsForms</c>
-    /// namespace that replaces this class.
-    /// </summary>
-    /// <remarks>
-    /// This will eventually be removed because all UI-framework-specific functionality is being
-    /// removed from <c>System.Reactive</c>. This is necessary to fix problems in which
-    /// <c>System.Reactive</c> causes applications to end up with dependencies on Windows Forms and
-    /// WPF whether they want them or not.
-    /// </remarks>
-    [Obsolete("Use System.Reactive.WindowsRuntime.CoreDispatcherScheduler in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-    [CLSCompliant(false)]
-    public sealed class CoreDispatcherScheduler : LocalScheduler, ISchedulerPeriodic
-    {
-        /// <summary>
-        /// Constructs a <see cref="CoreDispatcherScheduler"/> that schedules units of work on the given <see cref="CoreDispatcher"/>.
-        /// </summary>
-        /// <param name="dispatcher">Dispatcher to schedule work on.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is <c>null</c>.</exception>
-        public CoreDispatcherScheduler(CoreDispatcher dispatcher)
-        {
-            Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
-            Priority = CoreDispatcherPriority.Normal;           
-        }
-
-        /// <summary>
-        /// Constructs a <see cref="CoreDispatcherScheduler"/> that schedules units of work on the given <see cref="CoreDispatcher"/> with the given priority.
-        /// </summary>
-        /// <param name="dispatcher">Dispatcher to schedule work on.</param>
-        /// <param name="priority">Priority for scheduled units of work.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is <c>null</c>.</exception>
-        public CoreDispatcherScheduler(CoreDispatcher dispatcher, CoreDispatcherPriority priority)
-        {
-            Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
-            Priority = priority;
-        }
-
-        /// <summary>
-        /// Gets the scheduler that schedules work on the <see cref="CoreDispatcher"/> associated with the current Window.
-        /// </summary>
-        public static CoreDispatcherScheduler Current
-        {
-            get
-            {
-                var window = CoreWindow.GetForCurrentThread()
-                    ?? throw new InvalidOperationException(Strings_WindowsThreading.NO_WINDOW_CURRENT);
-                return new CoreDispatcherScheduler(window.Dispatcher);
-            }
-        }
-
-        /// <summary>
-        /// Gets the <see cref="CoreDispatcher"/> associated with the <see cref="CoreDispatcherScheduler"/>.
-        /// </summary>
-        public CoreDispatcher Dispatcher { get; }
-
-        private DispatcherQueue? _dispatcherQueue;
-
-        /// <summary>
-        /// Gets the priority at which work is scheduled.
-        /// </summary>
-        public CoreDispatcherPriority Priority { get; }
-
-        /// <summary>
-        /// Schedules an action to be executed on the dispatcher.
-        /// </summary>
-        /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
-        /// <param name="state">State passed to the action to be executed.</param>
-        /// <param name="action">Action to be executed.</param>
-        /// <returns>The disposable object used to cancel the scheduled action (best effort).</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception>
-        public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
-        {
-            if (action == null)
-            {
-                throw new ArgumentNullException(nameof(action));
-            }
-
-            var d = new SingleAssignmentDisposable();
-
-            var res = Dispatcher.RunAsync(Priority, () =>
-            {
-                if (!d.IsDisposed)
-                {
-                    try
-                    {
-                        d.Disposable = action(this, state);
-                    }
-                    catch (Exception ex)
-                    {
-                        //
-                        // Work-around for the behavior of throwing from RunAsync not propagating
-                        // the exception to the Application.UnhandledException event (as of W8RP)
-                        // as our users have come to expect from previous XAML stacks using Rx.
-                        //
-                        // If we wouldn't do this, there'd be an observable behavioral difference
-                        // between scheduling with TimeSpan.Zero or using this overload.
-                        //
-                        // For scheduler implementation guidance rules, see TaskPoolScheduler.cs
-                        // in System.Reactive.PlatformServices\Reactive\Concurrency.
-                        //
-                        
-                        var timer = CreateDispatcherQueue().CreateTimer();
-                        timer.Interval = TimeSpan.Zero;
-
-                        timer.Tick += (o, e) =>
-                        {
-                            timer.Stop();
-                            ExceptionDispatchInfo.Capture(ex).Throw();
-                        };
-
-                        timer.Start();
-                    }
-                }
-            });
-
-            return StableCompositeDisposable.Create(
-                d,
-                res.AsDisposable()
-            );
-        }
-
-        private DispatcherQueue CreateDispatcherQueue()
-        {
-            if(_dispatcherQueue != null)
-            {
-                return _dispatcherQueue;
-            }
-
-            if(Dispatcher.HasThreadAccess)
-            {
-                _dispatcherQueue = DispatcherQueue.GetForCurrentThread();
-                return _dispatcherQueue;
-            }
-
-            // We're on a different thread, get it from the right one
-            Dispatcher.RunAsync(CoreDispatcherPriority.High, () =>
-            {
-                _dispatcherQueue = DispatcherQueue.GetForCurrentThread();
-            }).GetAwaiter().GetResult(); // This is a synchronous call and we need the result to proceed
-
-            return _dispatcherQueue!;
-        }
-
-        /// <summary>
-        /// Schedules an action to be executed after <paramref name="dueTime"/> on the dispatcher, using a <see cref="DispatcherQueueTimer"/> object.
-        /// </summary>
-        /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
-        /// <param name="state">State passed to the action to be executed.</param>
-        /// <param name="action">Action to be executed.</param>
-        /// <param name="dueTime">Relative time after which to execute the action.</param>
-        /// <returns>The disposable object used to cancel the scheduled action (best effort).</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception>
-        public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
-        {
-            if (action == null)
-            {
-                throw new ArgumentNullException(nameof(action));
-            }
-
-            var dt = Scheduler.Normalize(dueTime);
-            if (dt.Ticks == 0)
-            {
-                return Schedule(state, action);
-            }
-
-            return ScheduleSlow(state, dt, action);
-        }
-
-        private IDisposable ScheduleSlow<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
-        {
-            var d = new MultipleAssignmentDisposable();
-
-            var timer = CreateDispatcherQueue().CreateTimer();
-
-            timer.Tick += (o, e) =>
-            {
-                var t = Interlocked.Exchange(ref timer, null);
-                if (t != null)
-                {
-                    try
-                    {
-                        d.Disposable = action(this, state);
-                    }
-                    finally
-                    {
-                        t.Stop();
-                        action = static (s, t) => Disposable.Empty;
-                    }
-                }
-            };
-
-            timer.Interval = dueTime;
-            timer.Start();
-
-            d.Disposable = Disposable.Create(() =>
-            {
-                var t = Interlocked.Exchange(ref timer, null);
-                if (t != null)
-                {
-                    t.Stop();
-                    action = static (s, t) => Disposable.Empty;
-                }
-            });
-
-            return d;
-        }
-
-        /// <summary>
-        /// Schedules a periodic piece of work on the dispatcher, using a <see cref="DispatcherQueueTimer"/> object.
-        /// </summary>
-        /// <typeparam name="TState">The type of the state passed to the scheduled action.</typeparam>
-        /// <param name="state">Initial state passed to the action upon the first iteration.</param>
-        /// <param name="period">Period for running the work periodically.</param>
-        /// <param name="action">Action to be executed, potentially updating the state.</param>
-        /// <returns>The disposable object used to cancel the scheduled recurring action (best effort).</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="action"/> is <c>null</c>.</exception>
-        /// <exception cref="ArgumentOutOfRangeException"><paramref name="period"/> is less than <see cref="TimeSpan.Zero"/>.</exception>
-        public IDisposable SchedulePeriodic<TState>(TState state, TimeSpan period, Func<TState, TState> action)
-        {
-            //
-            // According to MSDN documentation, the default is TimeSpan.Zero, so that's definitely valid.
-            // Empirical observation - negative values seem to be normalized to TimeSpan.Zero, but let's not go there.
-            //
-            if (period < TimeSpan.Zero)
-            {
-                throw new ArgumentOutOfRangeException(nameof(period));
-            }
-
-            if (action == null)
-            {
-                throw new ArgumentNullException(nameof(action));
-            }
-
-            var timer = CreateDispatcherQueue().CreateTimer();
-
-            var state1 = state;
-
-            timer.Tick += (o, e) =>
-            {
-                state1 = action(state1);
-            };
-
-            timer.Interval = period;
-            timer.Start();
-
-            return Disposable.Create(() =>
-            {
-                var t = Interlocked.Exchange(ref timer, null);
-                if (t != null)
-                {
-                    t.Stop();
-                    action = static _ => _;
-                }
-            });
-        }
-    }
-}
-#endif

+ 1 - 2
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Concurrency/ThreadPoolScheduler.Windows.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
-#if WINDOWS_UWP
 extern alias SystemReactiveNet;
 
 using System.ComponentModel;
@@ -10,6 +9,7 @@ using Windows.System.Threading;
 
 using SystemReactiveNet::System.Reactive.Concurrency;
 using System.Reactive.Uwp;
+using System.Reactive.WindowsRuntime;
 
 namespace System.Reactive.Concurrency
 {
@@ -223,4 +223,3 @@ namespace System.Reactive.Concurrency
         }
     }
 }
-#endif

+ 0 - 37
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/EventPatternSource.cs

@@ -1,37 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINRT
-extern alias SystemReactiveNet;
-using SystemReactiveNet::System.Reactive;
-using Windows.Foundation;
-
-namespace System.Reactive
-{
-    /// <summary>
-    /// Legacy implementation of obsolete <see cref="IEventPatternSource{TSender, TEventArgs}"/>
-    /// </summary>
-    [Obsolete]
-    internal sealed class EventPatternSource<TSender, TEventArgs> : EventPatternSourceBase<TSender, TEventArgs>, IEventPatternSource<TSender, TEventArgs>
-    {
-        public EventPatternSource(IObservable<EventPattern<TSender, TEventArgs>> source, Action<Action<TSender, TEventArgs>, /*object,*/ EventPattern<TSender, TEventArgs>> invokeHandler)
-            : base(source, invokeHandler)
-        {
-        }
-
-        event TypedEventHandler<TSender, TEventArgs> IEventPatternSource<TSender, TEventArgs>.OnNext
-        {
-            add
-            {
-                Add(value, (o, e) => value(o!, e));
-            }
-
-            remove
-            {
-                Remove(value);
-            }
-        }
-    }
-}
-#endif

+ 0 - 293
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Foundation/AsyncInfoExtensions.cs

@@ -1,293 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINRT
-extern alias SystemReactiveNet;
-using SystemReactiveNet::System;
-using SystemReactiveNet::System.Reactive;
-using SystemReactiveNet::System.Reactive.Linq;
-
-using Windows.Foundation;
-
-namespace System.Reactive.Windows.Foundation
-{
-    /// <summary>
-    /// Obsolete. Use the <c>AsyncInfoObservableExtensions</c> class in the
-    /// <c>System.Reactive.WindowsRuntime</c> namespace in the
-    /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// Since this obsolete class is the only public type in the <c>System.Reactive.Windows.Foundation</c>
-    /// namespace, existing code will normally need only to replace a using directive of
-    /// <c>using System.Reactive.Windows.Foundation;</c> with
-    /// <c>using System.Reactive.WindowsRuntime;</c>.
-    /// </para>
-    /// </remarks>
-    [CLSCompliant(false)]
-    [Obsolete("Use the System.Reactive.WindowsRuntime.AsyncInfoObservableExtensions class in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-    public static class AsyncInfoObservableExtensions
-    {
-        #region IAsyncAction and IAsyncActionWithProgress
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous action to an observable sequence.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <returns>An observable sequence that produces a unit value when the asynchronous action completes, or propagates the exception produced by the asynchronous action.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<Unit> ToObservable(this IAsyncAction source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return new AsyncInfoToObservableBridge<Unit, Unit>(
-                source,
-                static (iai, a) => ((IAsyncAction)iai).Completed += new AsyncActionCompletedHandler((iaa, status) => a(iaa, status)),
-                iai => Unit.Default,
-                onProgress: null,
-                progress: null,
-                multiValue: false
-            );
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous action to an observable sequence, ignoring its progress notifications.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TProgress">The type of the reported progress objects, which get ignored by this conversion.</typeparam>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <returns>An observable sequence that produces a unit value when the asynchronous action completes, or propagates the exception produced by the asynchronous action.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<Unit> ToObservable<TProgress>(this IAsyncActionWithProgress<TProgress> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return source.ToObservable_(null);
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous action to an observable sequence, reporting its progress through the supplied progress object.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TProgress">The type of the reported progress objects.</typeparam>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <param name="progress">Progress object to receive progress notifications on.</param>
-        /// <returns>An observable sequence that produces a unit value when the asynchronous action completes, or propagates the exception produced by the asynchronous action.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="progress"/> is null.</exception>
-        public static IObservable<Unit> ToObservable<TProgress>(this IAsyncActionWithProgress<TProgress> source, IProgress<TProgress> progress)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (progress == null)
-            {
-                throw new ArgumentNullException(nameof(progress));
-            }
-
-            return source.ToObservable_(progress);
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous action to an observable sequence reporting its progress.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TProgress">The type of the reported progress objects.</typeparam>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <returns>An observable sequence that produces progress values from the asynchronous action and notifies observers about the action's completion.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TProgress> ToObservableProgress<TProgress>(this IAsyncActionWithProgress<TProgress> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return Observable.Create<TProgress>(observer =>
-            {
-                var progress = observer.ToProgress();
-                var src = source.ToObservable_(progress);
-                return src.Subscribe(static _ => { }, observer.OnError, observer.OnCompleted);
-            });
-        }
-
-        private static IObservable<Unit> ToObservable_<TProgress>(this IAsyncActionWithProgress<TProgress> source, IProgress<TProgress>? progress)
-        {
-            return new AsyncInfoToObservableBridge<Unit, TProgress>(
-                source,
-                static (iai, a) => ((IAsyncActionWithProgress<TProgress>)iai).Completed += new AsyncActionWithProgressCompletedHandler<TProgress>((iaa, status) => a(iaa, status)),
-                iai => Unit.Default,
-                static (iai, a) => ((IAsyncActionWithProgress<TProgress>)iai).Progress += new AsyncActionProgressHandler<TProgress>((iap, p) => a(iap, p)),
-                progress,
-                multiValue: false
-            );
-        }
-
-        #endregion
-
-        #region IAsyncOperation and IAsyncOperationWithProgress
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous operation to an observable sequence reporting its result.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the operation's single result and its successful exceptional completion.
-        /// </summary>
-        /// <typeparam name="TResult">The type of the asynchronous operation's result.</typeparam>
-        /// <param name="source">Asynchronous operation to convert.</param>
-        /// <returns>An observable sequence that notifies observers about the asynchronous operation's result value and completion.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TResult> ToObservable<TResult>(this IAsyncOperation<TResult> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return new AsyncInfoToObservableBridge<TResult, Unit>(
-                source,
-                static (iai, a) => ((IAsyncOperation<TResult>)iai).Completed += new AsyncOperationCompletedHandler<TResult>((iao, status) => a(iao, status)),
-                static iai => ((IAsyncOperation<TResult>)iai).GetResults(),
-                onProgress: null,
-                progress: null,
-                multiValue: false
-            );
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous operation to an observable sequence reporting its result but ignoring its progress notifications.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the operations's single result and its successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TResult">The type of the asynchronous operation's result.</typeparam>
-        /// <typeparam name="TProgress">The type of the reported progress objects, which get ignored by this conversion.</typeparam>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <returns>An observable sequence that notifies observers about the asynchronous operation's result value and completion.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TResult> ToObservable<TResult, TProgress>(this IAsyncOperationWithProgress<TResult, TProgress> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return source.ToObservable_(null, false);
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous operation to an observable sequence reporting its result and reporting its progress through the supplied progress object.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the operations's single result and its successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TResult">The type of the asynchronous operation's result.</typeparam>
-        /// <typeparam name="TProgress">The type of the reported progress objects.</typeparam>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <param name="progress">Progress object to receive progress notifications on.</param>
-        /// <returns>An observable sequence that notifies observers about the asynchronous operation's result value and completion.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="progress"/> is null.</exception>
-        public static IObservable<TResult> ToObservable<TResult, TProgress>(this IAsyncOperationWithProgress<TResult, TProgress> source, IProgress<TProgress> progress)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (progress == null)
-            {
-                throw new ArgumentNullException(nameof(progress));
-            }
-
-            return source.ToObservable_(progress, false);
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous operation to an observable sequence reporting its progress but ignoring its result value.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TResult">The type of the asynchronous operation's result, which gets ignored by this conversion.</typeparam>
-        /// <typeparam name="TProgress">The type of the reported progress objects.</typeparam>
-        /// <param name="source">Asynchronous action to convert.</param>
-        /// <returns>An observable sequence that produces progress values from the asynchronous operation and notifies observers about the operations's completion.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TProgress> ToObservableProgress<TResult, TProgress>(this IAsyncOperationWithProgress<TResult, TProgress> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return Observable.Create<TProgress>(observer =>
-            {
-                var progress = observer.ToProgress();
-                var src = source.ToObservable_(progress, false);
-                return src.Subscribe(static _ => { }, observer.OnError, observer.OnCompleted);
-            });
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous operation to an observable sequence by retrieving the operation's results whenever progress is reported and when the operation completes.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TResult">The type of the asynchronous operation's result.</typeparam>
-        /// <typeparam name="TProgress">The type of the reported progress objects, which are used internally in the conversion but aren't exposed.</typeparam>
-        /// <param name="source">Asynchronous operation to convert.</param>
-        /// <returns>An observable sequence that notifies observers about the asynchronous operation's (incremental) result value(s) and completion.</returns>
-        /// <remarks>This conversion can be used with Windows Runtime APIs that support incremental retrieval of results during an asynchronous operation's execution.</remarks>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TResult> ToObservableMultiple<TResult, TProgress>(this IAsyncOperationWithProgress<TResult, TProgress> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return source.ToObservable_(null, true);
-        }
-
-        /// <summary>
-        /// Converts a Windows Runtime asynchronous operation to an observable sequence by retrieving the operation's results whenever progress is reported and when the operation completes. The operation's progress is reported through the supplied progress object.
-        /// Each observer subscribed to the resulting observable sequence will be notified about the action's successful or exceptional completion.
-        /// </summary>
-        /// <typeparam name="TResult">The type of the asynchronous operation's result.</typeparam>
-        /// <typeparam name="TProgress">The type of the reported progress objects.</typeparam>
-        /// <param name="source">Asynchronous operation to convert.</param>
-        /// <param name="progress">Progress object to receive progress notifications on.</param>
-        /// <returns>An observable sequence that notifies observers about the asynchronous operation's (incremental) result value(s) and completion.</returns>
-        /// <remarks>This conversion can be used with Windows Runtime APIs that support incremental retrieval of results during an asynchronous operation's execution.</remarks>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="progress"/> is null.</exception>
-        public static IObservable<TResult> ToObservableMultiple<TResult, TProgress>(this IAsyncOperationWithProgress<TResult, TProgress> source, IProgress<TProgress> progress)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (progress == null)
-            {
-                throw new ArgumentNullException(nameof(progress));
-            }
-
-            return source.ToObservable_(progress, true);
-        }
-
-        private static IObservable<TResult> ToObservable_<TResult, TProgress>(this IAsyncOperationWithProgress<TResult, TProgress> source, IProgress<TProgress>? progress, bool supportsMultiple)
-        {
-            return new AsyncInfoToObservableBridge<TResult, TProgress>(
-                source,
-                static (iai, a) => ((IAsyncOperationWithProgress<TResult, TProgress>)iai).Completed += new AsyncOperationWithProgressCompletedHandler<TResult, TProgress>((iao, status) => a(iao, status)),
-                iai => ((IAsyncOperationWithProgress<TResult, TProgress>)iai).GetResults(),
-                static (iai, a) => ((IAsyncOperationWithProgress<TResult, TProgress>)iai).Progress += new AsyncOperationProgressHandler<TResult, TProgress>((iap, p) => a(iap, p)),
-                progress,
-                supportsMultiple
-            );
-        }
-
-        #endregion
-    }
-}
-#endif

+ 0 - 122
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Foundation/AsyncInfoToObservableBridge.cs

@@ -1,122 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINRT
-extern alias SystemReactiveNet;
-
-using SystemReactiveNet::System.Reactive;
-using SystemReactiveNet::System.Reactive.Subjects;
-using Windows.Foundation;
-
-namespace System.Reactive.Windows.Foundation
-{
-    /// <summary>
-    /// Used only by the obsolete <see cref="AsyncInfoObservableExtensions"/> type.
-    /// </summary>
-    /// <typeparam name="TResult">The type of the asynchronous operation's result.</typeparam>
-    /// <typeparam name="TProgress">The type of the reported progress objects, which get ignored by this conversion.</typeparam>
-    /// <remarks>
-    /// This should be removed when <see cref="AsyncInfoObservableExtensions"/> is eventually removed.
-    /// </remarks>
-    [Obsolete]
-    internal sealed class AsyncInfoToObservableBridge<TResult, TProgress> : ObservableBase<TResult>
-    {
-        private readonly Action<IAsyncInfo, Action<IAsyncInfo, AsyncStatus>> _onCompleted;
-        private readonly Func<IAsyncInfo, TResult> _getResult;
-        private readonly AsyncSubject<TResult> _subject;
-
-        public AsyncInfoToObservableBridge(IAsyncInfo info, Action<IAsyncInfo, Action<IAsyncInfo, AsyncStatus>> onCompleted, Func<IAsyncInfo, TResult> getResult, Action<IAsyncInfo, Action<IAsyncInfo, TProgress>>? onProgress, IProgress<TProgress>? progress, bool multiValue)
-        {
-            _onCompleted = onCompleted;
-            _getResult = getResult;
-
-            _subject = new AsyncSubject<TResult>();
-
-            onProgress?.Invoke(info, (iai, p) =>
-            {
-                if (multiValue && getResult != null)
-                {
-                    _subject.OnNext(getResult(iai));
-                }
-
-                progress?.Report(p);
-            });
-
-            Done(info, info.Status, true);
-        }
-
-        private void Done(IAsyncInfo info, AsyncStatus status, bool initial)
-        {
-            var error = default(Exception);
-            var result = default(TResult);
-
-            //
-            // Initial interactions with the IAsyncInfo object. Those could fail, which indicates
-            // a rogue implementation. Failure is just propagated out.
-            //
-            switch (status)
-            {
-                case AsyncStatus.Error:
-                    error = info.ErrorCode;
-                    if (error == null)
-                    {
-                        throw new InvalidOperationException("The asynchronous operation failed with a null error code.");
-                    }
-
-                    break;
-                case AsyncStatus.Canceled:
-                    error = new OperationCanceledException();
-                    break;
-                case AsyncStatus.Completed:
-                    if (_getResult != null)
-                    {
-                        result = _getResult(info);
-                    }
-
-                    break;
-                default:
-                    if (!initial)
-                    {
-                        throw new InvalidOperationException("The asynchronous operation completed unexpectedly.");
-                    }
-
-                    _onCompleted(info, (iai, s) => Done(iai, s, false));
-                    return;
-            }
-
-            //
-            // Close as early as possible, before running continuations which could fail. In case of
-            // failure above, we don't close out the object in order to allow for debugging of the
-            // rogue implementation without losing state prematurely. Notice _getResult is merely
-            // an indirect call to the appropriate GetResults method, which is not supposed to throw.
-            // Instead, an Error status should be returned.
-            //
-            info.Close();
-
-            //
-            // Now we run the continuations, which could take a long time. Failure here is catastrophic
-            // and under control of the upstream subscriber.
-            //
-            if (error != null)
-            {
-                _subject.OnError(error);
-            }
-            else
-            {
-                if (_getResult != null)
-                {
-                    _subject.OnNext(result!); // NB: Has been assigned in switch statement above.
-                }
-
-                _subject.OnCompleted();
-            }
-        }
-
-        protected override IDisposable SubscribeCore(IObserver<TResult> observer)
-        {
-            return _subject.Subscribe(observer);
-        }
-    }
-}
-#endif

+ 0 - 83
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/IEventPatternSource.cs

@@ -1,83 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINRT
-extern alias SystemReactiveNet;
-using SystemReactiveNet::System.Reactive;
-
-using Windows.Foundation;
-
-namespace System.Reactive
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsRuntime</c> NuGet package defines an
-    /// <c>ITypedEventPatternSource</c> interface that should be used instead.
-    /// </summary>
-    /// <typeparam name="TSender">Sender type.</typeparam>
-    /// <typeparam name="TEventArgs">Event arguments type.</typeparam>
-    /// <remarks>
-    /// <para>
-    /// This type is specific to Windows Runtime, because the <see cref="OnNext"/> member uses the
-    /// <see cref="TypedEventHandler{TSender, TResult}"/> type. This interface has therefore been
-    /// marked as Obsolete as part of a drive to remove all UI-framework-specific and platform-
-    /// specific types and members from the main <c>System.Reactive</c> package.
-    /// </para>
-    /// <para>
-    /// The replacement type is not just in a different package and namespace. Its name has been
-    /// changed to <c>ITypedEventPatternSource</c>. There are two reasons.
-    /// </para>
-    /// <para>
-    /// First, the choice of name and namespace implied, wrongly, that this was a general purpose
-    /// type like <see cref="IEventPattern{TSender, TEventArgs}"/> or
-    /// <see cref="IEventPatternSource{TEventArgs}"/>. It is not, because it can't exist in TFMs
-    /// where Windows Runtime is unavailable, such as <c>net8.0</c> or <c>netstandard2.0</c>. It
-    /// was especially confusing to give this the same name as the single-type-argument
-    /// <see cref="IEventPatternSource{TEventArgs}"/>, which has no such restriction. By differing
-    /// only in the number of type arguments, these types strongly implied that they were just
-    /// different forms of the same thing, when one was in fact only possible to use on certain
-    /// Windows targets.
-    /// </para>
-    /// <para>
-    /// Second, the fact that this was placed in the <c>System.Reactive</c> namespace means that
-    /// simply adding a replacement type with the same simple name in a different namespace is
-    /// likely to cause problems, because code may well have <c>System.Reactive</c> in scope for
-    /// other reasons. This could make it difficult for code to move cleanly onto the new
-    /// definition for as long as the old one remains present in <c>Obsolete</c> form, because it
-    /// might not always be possible to replace <c>using System.Reactive;</c> with, say,
-    /// <c>using System.Reactive.WindowsRuntime;</c>
-    /// </para>
-    /// <para>
-    /// The main reason for pushing such code out into separate packages is to avoid a problem in
-    /// which applications with a Windows-specific TFM end up acquiring dependencies on WPF and
-    /// Windows Forms when they take a dependency on <c>System.Reactive</c> regardless of whether
-    /// they are actually using those UI frameworks. In principle, we don't need to remove this
-    /// particular interface because <see cref="TypedEventHandler{TSender, TResult}"/> is not
-    /// technically specific to one framework. (It gets used in both UWP and WinUI. And since you
-    /// can use WinRT APIs in Windows Forms, WPF, and even Console applications, technically those
-    /// can use it too, although in most cases they wouldn't.) However, leaving Windows Runtime
-    /// APIs in the main <c>System.Reactive</c> component would mean we would still need to produce
-    /// both <c>netX.0</c> and <c>netX.0-windows10.0.YYYYY</c> TFMs even after we finally remove
-    /// all of the Obsolete types and members. People regularly get confused by the fact that in
-    /// the Rx v >=6.0 design, to get WPF or Windows Forms support today you need to use a suitably
-    /// recent Windows-specific TFM. If we retained that TFM but removed the UI framework support
-    /// from it leaving just the non-UI-framework-specific WinRT support) it seems likely that we
-    /// would cause even more confusion. So we want to get <c>System.Reactive</c> to a state where,
-    /// once we've removed all Obsolete types andmembers, we will need only non-OS-specific TFMs.
-    /// We are therefore moving all Windows Runtime/Foundation support out into a separate package
-    /// as well 
-    /// </para>
-    /// </remarks>
-    [CLSCompliant(false)]
-    [Obsolete("Use the System.Reactive.WindowsRuntime.ITypedEventPatternSource interface in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-    public interface IEventPatternSource<TSender, TEventArgs>
-    {
-        /// <summary>
-        /// Event signaling the next element in the data stream.
-        /// </summary>
-#pragma warning disable CA1003 // (Use generic EventHandler.) The use of the Windows.Foundation handler type is by design
-        event TypedEventHandler<TSender, TEventArgs> OnNext;
-#pragma warning restore CA1003
-    }
-}
-#endif

+ 0 - 309
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/AsyncInfoObservable.cs

@@ -1,309 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINRT
-extern alias SystemReactiveNet;
-
-using SystemReactiveNet::System;
-using SystemReactiveNet::System.Reactive;
-using SystemReactiveNet::System.Reactive.Linq;
-using SystemReactiveNet::System.Reactive.Threading.Tasks;
-
-using System.Runtime.InteropServices.WindowsRuntime;
-using System.Threading.Tasks;
-using Windows.Foundation;
-
-namespace System.Reactive.Linq
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsRuntime</c> NuGet package defines a
-    /// <c>WindowsRuntimeAsyncInfoObservable</c> class that defines new extension methods to be used in
-    /// place of these (also in the <c>System.Reactive.Linq</c> namespace).
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// The replacement <c>WindowsRuntimeAsyncInfoObservable</c> class uses different method names.
-    /// When you migrate to that new class from this obsolete one, you will need to change your code
-    /// to invoke different method names:
-    /// </para>
-    /// <list type="table">
-    ///     <listheader><term>Rx &lt;= 6.0</term><term>Now</term></listheader>
-    ///     <item>
-    ///         <term><c>ToAsyncAction</c></term>
-    ///         <term><c>ToIAsyncAction</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>ToAsyncActionWithProgress</c></term>
-    ///         <term><c>ToIAsyncActionWithProgress</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>ToAsyncOperation</c></term>
-    ///         <term><c>ToIAsyncOperation</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>ToAsyncOperationWithProgress</c></term>
-    ///         <term><c>ToIAsyncOperationWithProgress</c></term>
-    ///     </item>
-    /// </list>
-    /// <para>
-    /// This name change is necessary because of a limitation of the <c>Obsolete</c> attribute: if
-    /// you want to move an existing method into a different package, and you leave the old one in
-    /// place (and marked as <c>Obsolete</c>) for a few versions to enable a gradual transition to
-    /// the new one, you will cause a problem if you keep the method name the same. The problem
-    /// is that both the old and new extension methods will be in scope simultaneously, so the
-    /// compiler will complain of ambiguity when you try to use them. In some cases you can
-    /// mitigate this by defining the new type in a different namespace, but the problem is that
-    /// these extension methods for <see cref="IObservable{T}"/> are defined in the
-    /// <c>System.Reactive.Linq</c> namespace. Code often brings that namespace into scope for more
-    /// than one reason, so we can't just tell developers to replace <c>using
-    /// System.Reactive.Linq;</c> with some other namespace. While that might fix the ambiguity
-    /// problem, it's likely to cause a load of new problems instead.
-    /// </para>
-    /// <para>
-    /// The only practical solution for this is for the new methods to have different names than
-    /// the old ones. (There is a proposal for being able to annotate a method as being for binary
-    /// compatibility only, but it will be some time before that is available to all projects using
-    /// Rx.NET.)
-    /// </para>
-    /// <para>
-    /// This type will eventually be removed because all UI-framework-specific functionality is
-    /// being removed from <c>System.Reactive</c>. This is necessary to fix problems in which
-    /// <c>System.Reactive</c> causes applications to end up with dependencies on Windows Forms and
-    /// WPF whether they want them or not. Strictly speaking, the <see cref="IAsyncAction"/>,
-    /// <see cref="IAsyncActionWithProgress{TProgress}"/>, <see cref="IAsyncOperation{TResult}"/>
-    /// and <see cref="IAsyncOperationWithProgress{TResult, TProgress}"/> types that this class
-    /// supports are part of Windows Runtime, and aren't specific to a single UI framework. These
-    /// types are used routinely in both UWP and WinUI applications, but it's also possible to use
-    /// them from Windows Forms, WPF, and even console applications. These types are effectively
-    /// WinRT native way of representing what the TPL's various Task types represent in a purely
-    /// .NET world. Even so, once support for genuinely UI-framework-specific types (such as
-    /// WPF's <c>Dispatcher</c>) has been removed from Rx.NET, support for these Windows Runtime
-    /// types would require us to continue to offer <c>netX.0</c> and <c>netX.0-windows10.0.YYYYY</c>
-    /// TFMs. The fact that we offer both has caused confusion because it's quite possible to get the
-    /// former even when running on Windows.
-    /// </para>
-    /// </remarks>
-    [Obsolete("Use the extension methods defined by the System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable class in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-    [CLSCompliant(false)]
-    public static class AsyncInfoObservable
-    {
-        #region IAsyncAction
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToIAsyncAction</c> method in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence to expose as an asynchronous action.</param>
-        /// <returns>Windows Runtime asynchronous action object representing the completion of the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncAction extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncAction ToAsyncAction<TSource>(this IObservable<TSource> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return AsyncInfo.Run(ct => (Task)source.DefaultIfEmpty().ToTask(ct));
-        }
-
-        #region Progress
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToIAsyncActionWithProgress</c>
-        /// method in the <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence to expose as an asynchronous action.</param>
-        /// <returns>Windows Runtime asynchronous action object representing the completion of the observable sequence, reporting incremental progress for each source sequence element.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncActionWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncActionWithProgress<int> ToAsyncActionWithProgress<TSource>(this IObservable<TSource> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return AsyncInfo.Run<int>((ct, progress) =>
-            {
-                var i = 0;
-                return source.Do(_ => progress.Report(i++)).DefaultIfEmpty().ToTask(ct);
-            });
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToIAsyncActionWithProgress</c>
-        /// method in the <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TProgress">The type of the elements in the progress sequence.</typeparam>
-        /// <param name="source">Source sequence to expose as an asynchronous action and to compute a progress sequence that gets reported through the asynchronous action.</param>
-        /// <param name="progressSelector">Selector function to map the source sequence on a progress reporting sequence.</param>
-        /// <returns>Windows Runtime asynchronous action object representing the completion of the result sequence, reporting progress computed through the progress sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="progressSelector"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncActionWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncActionWithProgress<TProgress> ToAsyncActionWithProgress<TSource, TProgress>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TProgress>> progressSelector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (progressSelector == null)
-            {
-                throw new ArgumentNullException(nameof(progressSelector));
-            }
-
-            return AsyncInfo.Run<TProgress>((ct, progress) =>
-            {
-                return Observable.Create<TSource?>(observer =>
-                {
-                    var obs = Observer.Synchronize(observer);
-
-                    var data = source.Publish();
-
-                    var progressSubscription = progressSelector(data).Subscribe(progress.Report, obs.OnError);
-                    var dataSubscription = data.DefaultIfEmpty().Subscribe(obs);
-                    var connection = data.Connect();
-
-                    return StableCompositeDisposable.CreateTrusted(progressSubscription, dataSubscription, connection);
-                }).ToTask(ct);
-            });
-        }
-
-        #endregion
-
-        #endregion
-
-        #region IAsyncOperation<T>
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToAsyncOperation</c> method in
-        /// the <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence to expose as an asynchronous operation.</param>
-        /// <returns>Windows Runtime asynchronous operation object that returns the last element of the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncOperation extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncOperation<TSource> ToAsyncOperation<TSource>(this IObservable<TSource> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return AsyncInfo.Run(ct => source.ToTask(ct));
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToIAsyncOperationWithProgress</c>
-        /// method in the <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence to expose as an asynchronous operation.</param>
-        /// <returns>Windows Runtime asynchronous operation object that returns the last element of the observable sequence, reporting incremental progress for each source sequence element.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncOperationWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncOperationWithProgress<TSource, int> ToAsyncOperationWithProgress<TSource>(this IObservable<TSource> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return AsyncInfo.Run<TSource, int>((ct, progress) =>
-            {
-                var i = 0;
-                return source.Do(_ => progress.Report(i++)).ToTask(ct);
-            });
-        }
-
-        #region Progress
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToIAsyncOperationWithProgress</c>
-        /// method in the <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TResult">The type of the elements in the result sequence.</typeparam>
-        /// <param name="source">Source sequence to compute a result sequence that gets exposed as an asynchronous operation.</param>
-        /// <param name="resultSelector">Selector function to map the source sequence on a result sequence.</param>
-        /// <returns>Windows Runtime asynchronous operation object that returns the last element of the result sequence, reporting incremental progress for each source sequence element.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="resultSelector"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncOperationWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncOperationWithProgress<TResult, int> ToAsyncOperationWithProgress<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> resultSelector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (resultSelector == null)
-            {
-                throw new ArgumentNullException(nameof(resultSelector));
-            }
-
-            return AsyncInfo.Run<TResult, int>((ct, progress) =>
-            {
-                var i = 0;
-                return resultSelector(source.Do(_ => progress.Report(i++))).ToTask(ct);
-            });
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>WindowsRuntimeAsyncInfoObservable.ToIAsyncOperationWithProgress</c>
-        /// method in the <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TResult">The type of the elements in the result sequence.</typeparam>
-        /// <typeparam name="TProgress">The type of the elements in the progress sequence.</typeparam>
-        /// <param name="source">Source sequence to compute a result sequence that gets exposed as an asynchronous operation and a progress sequence that gets reported through the asynchronous operation.</param>
-        /// <param name="resultSelector">Selector function to map the source sequence on a result sequence.</param>
-        /// <param name="progressSelector">Selector function to map the source sequence on a progress reporting sequence.</param>
-        /// <returns>Windows Runtime asynchronous operation object that returns the last element of the result sequence, reporting progress computed through the progress sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="resultSelector"/> or <paramref name="progressSelector"/> is null.</exception>
-        [Obsolete("Use the ToIAsyncOperationWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IAsyncOperationWithProgress<TResult, TProgress> ToAsyncOperationWithProgress<TSource, TResult, TProgress>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> resultSelector, Func<IObservable<TSource>, IObservable<TProgress>> progressSelector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (resultSelector == null)
-            {
-                throw new ArgumentNullException(nameof(resultSelector));
-            }
-
-            if (progressSelector == null)
-            {
-                throw new ArgumentNullException(nameof(progressSelector));
-            }
-
-            return AsyncInfo.Run<TResult, TProgress>((ct, progress) =>
-            {
-                return Observable.Create<TResult>(observer =>
-                {
-                    var obs = Observer.Synchronize(observer);
-
-                    var data = source.Publish();
-
-                    var progressSubscription = progressSelector(data).Subscribe(progress.Report, obs.OnError);
-                    var dataSubscription = resultSelector(data).Subscribe(obs);
-                    var connection = data.Connect();
-
-                    return StableCompositeDisposable.CreateTrusted(progressSubscription, dataSubscription, connection);
-                }).ToTask(ct);
-            });
-        }
-
-        #endregion
-
-        #endregion
-    }
-}
-#endif

+ 0 - 406
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/CoreDispatcherObservable.cs

@@ -1,406 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if WINDOWS
-using System.Reactive.Concurrency;
-using Windows.UI.Core;
-
-#if HAS_OS_XAML
-using Windows.UI.Xaml;
-#endif
-
-namespace System.Reactive.Linq
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsRuntime</c> NuGet package defines a
-    /// <c>WindowsRuntimeCoreDispatcherObservable</c> class that defines new extension methods to
-    /// be used in place of these (also in the <c>System.Reactive.Linq</c> namespace).
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// The replacement <c>WindowsRuntimeCoreDispatcherObservable</c> class uses different names for extension
-    /// methods. When you migrate to that new class from this obsolete one, you will need to change
-    /// your code to invoke different method names:
-    /// </para>
-    /// <list type="table">
-    ///     <listheader><term>Rx &lt;= 6.0</term><term>Now</term></listheader>
-    ///     <item>
-    ///         <term><c>ObserveOn</c></term>
-    ///         <term><c>ObserveOnWindowsRuntimeCoreDispatcher</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>ObserveOnCoreDispatcher</c></term>
-    ///         <term><c>ObserveOnCurrentWindowsRuntimeCoreDispatcher</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>SubscribeOn</c></term>
-    ///         <term><c>SubscribeOnWindowsRuntimeCoreDispatcher</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>SubscribeOnCoreDispatcher</c></term>
-    ///         <term><c>SubscribeOnCurrentWindowsRuntimeCoreDispatcher</c></term>
-    ///     </item>
-    /// </list>
-    /// <para>
-    /// The name changes are necessary because of a limitation of the <c>Obsolete</c> attribute: if
-    /// you want to move an existing extension method into a different package, and you leave the
-    /// old one in place (and marked as <c>Obsolete</c>) for a few versions to enable a gradual
-    /// transition to the new one, you will cause a problem if you keep the method name the same.
-    /// The problem is that both the old and new extension methods will be in scope simultaneously,
-    /// so the compiler will complain of ambiguity when you try to use them. In some cases you can
-    /// mitigate this by defining the new type in a different namespace, but the problem is that
-    /// these extension methods for <see cref="IObservable{T}"/> are defined in the
-    /// <c>System.Reactive.Linq</c> namespace. Code often brings that namespace into scope for more
-    /// than one reason, so we can't just tell developers to replace <c>using
-    /// System.Reactive.Linq;</c> with some other namespace. While that might fix the ambiguity
-    /// problem, it's likely to cause a load of new problems instead.
-    /// </para>
-    /// <para>
-    /// The only practical solution for this is for the new methods to have different names than
-    /// the old ones. (There is a proposal for being able to annotate a method as being for binary
-    /// compatibility only, but it will be some time before that is available to all projects using
-    /// Rx.NET.)
-    /// </para>
-    /// <para>
-    /// This type will eventually be removed because all UI-framework-specific functionality is
-    /// being removed from <c>System.Reactive</c>. This is necessary to fix problems in which
-    /// <c>System.Reactive</c> causes applications to end up with dependencies on Windows Forms and
-    /// WPF whether they want them or not.
-    /// </para>
-    /// </remarks>
-    [CLSCompliant(false)]
-    [Obsolete("Use the extension methods defined by the System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable class in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-    public static class CoreDispatcherObservable
-    {
-        #region ObserveOn[CoreDispatcher]
-
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dispatcher">Dispatcher whose associated message loop is used to notify observers on.</param>
-        /// <returns>The source sequence whose observations happen on the specified dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
-        [Obsolete("Use the ObserveOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dispatcher == null)
-            {
-                throw new ArgumentNullException(nameof(dispatcher));
-            }
-
-            return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dispatcher));
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dispatcher">Dispatcher whose associated message loop is used to notify observers on.</param>
-        /// <param name="priority">Priority to schedule work items at.</param>
-        /// <returns>The source sequence whose observations happen on the specified dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
-        [Obsolete("Use the ObserveOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dispatcher == null)
-            {
-                throw new ArgumentNullException(nameof(dispatcher));
-            }
-
-            return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dispatcher, priority));
-        }
-
-#if HAS_OS_XAML
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dependencyObject">Object to get the dispatcher from.</param>
-        /// <returns>The source sequence whose observations happen on the specified object's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
-        [Obsolete("Use the ObserveOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dependencyObject == null)
-            {
-                throw new ArgumentNullException(nameof(dependencyObject));
-            }
-
-            return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher));
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dependencyObject">Object to get the dispatcher from.</param>
-        /// <param name="priority">Priority to schedule work items at.</param>
-        /// <returns>The source sequence whose observations happen on the specified object's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
-        [Obsolete("Use the ObserveOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dependencyObject == null)
-            {
-                throw new ArgumentNullException(nameof(dependencyObject));
-            }
-
-            return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher, priority));
-        }
-#endif
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnCurrentWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <returns>The source sequence whose observations happen on the current window's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ObserveOnCurrentWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> ObserveOnCoreDispatcher<TSource>(this IObservable<TSource> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return Synchronization.ObserveOn(source, CoreDispatcherScheduler.Current);
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>ObserveOnCurrentWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="priority">Priority to schedule work items at.</param>
-        /// <returns>The source sequence whose observations happen on the current window's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ObserveOnCurrentWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> ObserveOnDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(CoreDispatcherScheduler.Current.Dispatcher, priority));
-        }
-
-        #endregion
-
-        #region SubscribeOn[CoreDispatcher]
-
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dispatcher">Dispatcher whose associated message loop is used to perform subscription and unsubscription actions on.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher.
-        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, CoreDispatcher)"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dispatcher == null)
-            {
-                throw new ArgumentNullException(nameof(dispatcher));
-            }
-
-            return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher));
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dispatcher">Dispatcher whose associated message loop is used to perform subscription and unsubscription actions on.</param>
-        /// <param name="priority">Priority to schedule work items at.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the specified dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher.
-        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, CoreDispatcher, CoreDispatcherPriority)"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dispatcher == null)
-            {
-                throw new ArgumentNullException(nameof(dispatcher));
-            }
-
-            return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher, priority));
-        }
-
-#if HAS_OS_XAML
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dependencyObject">Object to get the dispatcher from.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the specified object's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the specified object.
-        /// In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, DependencyObject)"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dependencyObject == null)
-            {
-                throw new ArgumentNullException(nameof(dependencyObject));
-            }
-
-            return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher));
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="dependencyObject">Object to get the dispatcher from.</param>
-        /// <param name="priority">Priority to schedule work items at.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the specified object's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the specified object.
-        /// In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, DependencyObject, CoreDispatcherPriority)"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (dependencyObject == null)
-            {
-                throw new ArgumentNullException(nameof(dependencyObject));
-            }
-
-            return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher, priority));
-        }
-#endif
-
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnCurrentWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the current window's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the current window.
-        /// In order to invoke observer callbacks on the dispatcher associated with the current window, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOnCoreDispatcher{TSource}(IObservable{TSource})"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnCurrentWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> SubscribeOnCoreDispatcher<TSource>(this IObservable<TSource> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return Synchronization.SubscribeOn(source, CoreDispatcherScheduler.Current);
-        }
-
-        /// <summary>
-        /// Obsolete. Use the <c>SubscribeOnCurrentWindowsRuntimeCoreDispatcher</c> extension method defined by
-        /// <c>System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable</c> in the
-        /// <c>System.Reactive.For.WindowsRuntime</c> package instead.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <param name="source">Source sequence.</param>
-        /// <param name="priority">Priority to schedule work items at.</param>
-        /// <returns>The source sequence whose subscriptions and unsubscriptions happen on the current window's dispatcher.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <remarks>
-        /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the current window.
-        /// In order to invoke observer callbacks on the dispatcher associated with the current window, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource}, CoreDispatcherPriority)"/>.
-        /// </remarks>
-        [Obsolete("Use the SubscribeOnCurrentWindowsRuntimeCoreDispatcher extension method defined by System.Reactive.Linq.WindowsRuntimeCoreDispatcherObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<TSource> SubscribeOnDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(CoreDispatcherScheduler.Current.Dispatcher, priority));
-        }
-
-        #endregion
-    }
-}
-#endif

+ 0 - 190
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/WindowsObservable.Events.cs

@@ -1,190 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-#if HAS_WINRT
-extern alias SystemReactiveNet;
-using SystemReactiveNet::System.Reactive;
-using SystemReactiveNet::System.Reactive.Linq;
-using Windows.Foundation;
-
-namespace System.Reactive.Linq
-{
-    /// <summary>
-    /// Obsolete. The <c>System.Reactive.For.WindowsRuntime</c> NuGet package defines a
-    /// <c>WindowsRuntimeObservable</c> class (also in the <c>System.Reactive.Linq</c> namespace)
-    /// to use instead.
-    /// </summary>
-    /// <remarks>
-    /// <para>
-    /// The replacement <c>WindowsRuntimeObservable</c> class uses different names for extension
-    /// methods. When you migrate to that new class from this obsolete one, you will need to change
-    /// your code to invoke different method names:
-    /// </para>
-    /// <list type="table">
-    ///     <listheader><term>Rx &lt;= 6.0</term><term>Now</term></listheader>
-    ///     <item>
-    ///         <term><c>ToEventPattern</c></term>
-    ///         <term><c>ToWindowsFoundationEventPattern</c></term>
-    ///     </item>
-    ///     <item>
-    ///         <term><c>SelectMany</c></term>
-    ///         <term><c>SelectManyIAsyncOperation</c> or <c>SelectManyIAsyncOperationWithProgress</c></term>
-    ///     </item>
-    /// </list>
-    /// <para>
-    /// (Note that the <c>FromEventPattern</c> method name has not changed.)
-    /// </para>
-    /// <para>
-    /// The name changes are necessary because of a limitation of the <c>Obsolete</c> attribute: if
-    /// you want to move an existing extension method into a different package, and you leave the
-    /// old one in place (and marked as <c>Obsolete</c>) for a few versions to enable a gradual
-    /// transition to the new one, you will cause a problem if you keep the method name the same.
-    /// The problem is that both the old and new extension methods will be in scope simultaneously,
-    /// so the compiler will complain of ambiguity when you try to use them. In some cases you can
-    /// mitigate this by defining the new type in a different namespace, but the problem is that
-    /// these extension methods for <see cref="IObservable{T}"/> are defined in the
-    /// <c>System.Reactive.Linq</c> namespace. Code often brings that namespace into scope for more
-    /// than one reason, so we can't just tell developers to replace <c>using
-    /// System.Reactive.Linq;</c> with some other namespace. While that might fix the ambiguity
-    /// problem, it's likely to cause a load of new problems instead.
-    /// </para>
-    /// <para>
-    /// The only practical solution for this is for the new methods to have different names than
-    /// the old ones. (There is a proposal for being able to annotate a method as being for binary
-    /// compatibility only, but it will be some time before that is available to all projects using
-    /// Rx.NET.)
-    /// </para>
-    /// <para>
-    /// The <c>FromEventPattern</c> methods keep the same name because those are not extension
-    /// methods, so they are always invoked through their class name. The replacement class has a
-    /// different name, <c>WindowsRuntimeObservable</c>, so there is no ambiguity.
-    /// </para>
-    /// <para>
-    /// This type will eventually be removed because all UI-framework-specific functionality is
-    /// being removed from <c>System.Reactive</c>. This is necessary to fix problems in which
-    /// <c>System.Reactive</c> causes applications to end up with dependencies on Windows Forms and
-    /// WPF whether they want them or not. Strictly speaking, the <see cref="IAsyncAction"/>,
-    /// <see cref="IAsyncActionWithProgress{TProgress}"/>, <see cref="IAsyncOperation{TResult}"/>
-    /// and <see cref="IAsyncOperationWithProgress{TResult, TProgress}"/> types that this class
-    /// supports are part of Windows Runtime, and aren't specific to a single UI framework. These
-    /// types are used routinely in both UWP and WinUI applications, but it's also possible to use
-    /// them from Windows Forms, WPF, and even console applications. These types are effectively
-    /// WinRT native way of representing what the TPL's various Task types represent in a purely
-    /// .NET world. Even so, once support for genuinely UI-framework-specific types (such as
-    /// WPF's <c>Dispatcher</c>) has been removed from Rx.NET, support for these Windows Runtime
-    /// types would require us to continue to offer <c>netX.0</c> and <c>netX.0-windows10.0.YYYYY</c>
-    /// TFMs. The fact that we offer both has caused confusion because it's quite possible to get the
-    /// former even when running on Windows.
-    /// </para>
-       /// </remarks>
-    [Obsolete("Use the System.Reactive.Linq.WindowsRuntimeObservable class in the System.Reactive.For.WindowsRuntime instead", error: false)]
-    [CLSCompliant(false)]
-    public static partial class WindowsObservable
-    {
-        /// <summary>
-        /// Converts a typed event, conforming to the standard event pattern, to an observable sequence.
-        /// </summary>
-        /// <typeparam name="TSender">The type of the sender that raises the event.</typeparam>
-        /// <typeparam name="TResult">The type of the event data generated by the event.</typeparam>
-        /// <param name="addHandler">Action that attaches the given event handler to the underlying .NET event.</param>
-        /// <param name="removeHandler">Action that detaches the given event handler from the underlying .NET event.</param>
-        /// <returns>The observable sequence that contains data representations of invocations of the underlying typed event.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="addHandler"/> or <paramref name="removeHandler"/> is null.</exception>
-        /// <seealso cref="ToEventPattern"/>
-        [Obsolete("Use the FromEventPattern method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<EventPattern<TSender, TResult>> FromEventPattern<TSender, TResult>(Action<TypedEventHandler<TSender, TResult>> addHandler, Action<TypedEventHandler<TSender, TResult>> removeHandler)
-        {
-            if (addHandler == null)
-            {
-                throw new ArgumentNullException(nameof(addHandler));
-            }
-
-            if (removeHandler == null)
-            {
-                throw new ArgumentNullException(nameof(removeHandler));
-            }
-
-            return Observable.Create<EventPattern<TSender, TResult>>(observer =>
-            {
-                var h = new TypedEventHandler<TSender, TResult>((sender, args) =>
-                {
-                    observer.OnNext(new EventPattern<TSender, TResult>(sender, args));
-                });
-
-                addHandler(h);
-
-                return () =>
-                {
-                    removeHandler(h);
-                };
-            });
-        }
-
-        /// <summary>
-        /// Converts a typed event, conforming to the standard event pattern, to an observable sequence.
-        /// </summary>
-        /// <typeparam name="TDelegate">The delegate type of the event to be converted.</typeparam>
-        /// <typeparam name="TSender">The type of the sender that raises the event.</typeparam>
-        /// <typeparam name="TResult">The type of the event data generated by the event.</typeparam>
-        /// <param name="conversion">A function used to convert the given event handler to a delegate compatible with the underlying typed event. The resulting delegate is used in calls to the addHandler and removeHandler action parameters.</param>
-        /// <param name="addHandler">Action that attaches the given event handler to the underlying .NET event.</param>
-        /// <param name="removeHandler">Action that detaches the given event handler from the underlying .NET event.</param>
-        /// <returns>The observable sequence that contains data representations of invocations of the underlying typed event.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="conversion"/> or <paramref name="addHandler"/> or <paramref name="removeHandler"/> is null.</exception>
-        /// <seealso cref="ToEventPattern"/>
-        [Obsolete("Use the FromEventPattern method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IObservable<EventPattern<TSender, TResult>> FromEventPattern<TDelegate, TSender, TResult>(Func<TypedEventHandler<TSender, TResult>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
-        {
-            if (conversion == null)
-            {
-                throw new ArgumentNullException(nameof(conversion));
-            }
-
-            if (addHandler == null)
-            {
-                throw new ArgumentNullException(nameof(addHandler));
-            }
-
-            if (removeHandler == null)
-            {
-                throw new ArgumentNullException(nameof(removeHandler));
-            }
-
-            return Observable.Create<EventPattern<TSender, TResult>>(observer =>
-            {
-                var h = conversion(new TypedEventHandler<TSender, TResult>((sender, args) =>
-                {
-                    observer.OnNext(new EventPattern<TSender, TResult>(sender, args));
-                }));
-
-                addHandler(h);
-
-                return () =>
-                {
-                    removeHandler(h);
-                };
-            });
-        }
-
-        /// <summary>
-        /// Exposes an observable sequence as an object with a typed event.
-        /// </summary>
-        /// <typeparam name="TSender">The type of the sender that raises the event.</typeparam>
-        /// <typeparam name="TEventArgs">The type of the event data generated by the event.</typeparam>
-        /// <param name="source">Observable source sequence.</param>
-        /// <returns>The event source object.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [Obsolete("Use the ToWindowsFoundationEventPattern extension method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
-        public static IEventPatternSource<TSender, TEventArgs> ToEventPattern<TSender, TEventArgs>(this IObservable<EventPattern<TSender, TEventArgs>> source)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            return new EventPatternSource<TSender, TEventArgs>(source, static (h, evt) => h(evt.Sender!, evt.EventArgs));
-        }
-    }
-}
-#endif

+ 21 - 3
Rx.NET/Source/facades/System.Reactive/System.Reactive.csproj

@@ -47,21 +47,34 @@
     <EmbeddedResource Remove="Obsolete\**\*.*" />
     <!-- Workaround so the files appear in VS -->
     <None Include="Obsolete\**\*.*" />
-    <Compile Include="..\..\src\System.Reactive.For.Uwp\Stubs.cs" Link="Obsolete\UWP\Stubs.cs" />
+    <None Include="..\..\src\System.Reactive.For.Uwp\Stubs.cs" Link="Obsolete\UWP\Stubs.cs" />
+    <None Include="..\..\src\System.Reactive.For.Uwp\ThreadPoolTimerExtensions.cs" Link="Obsolete\UWP\Concurrency\ThreadPoolTimerExtensions.cs" />
     <None Update="Linq\QbservableEx.NAry.tt">
       <Generator>TextTemplatingFileGenerator</Generator>
       <LastGenOutput>QbservableEx.NAry.cs</LastGenOutput>
     </None>
   </ItemGroup>
 
+  <ItemGroup Condition="$(TargetFramework.StartsWith('uap10.0'))">
+    <Compile Include="Obsolete\UWP\**\*.cs" />
+    <Compile Include="..\..\src\System.Reactive.For.Uwp\Stubs.cs" Link="Obsolete\UWP\Stubs.cs" />
+    <Compile Include="..\..\src\System.Reactive.For.Uwp\ThreadPoolTimerExtensions.cs" Link="Obsolete\UWP\Concurrency\ThreadPoolTimerExtensions.cs" />
+  </ItemGroup>
+
 
-  <!-- UWP -->
+    <!-- WindowsRuntime (netX.0-windows and UWP) -->
   <ItemGroup Condition=" $(TargetFramework.StartsWith('uap10.0')) or $(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
-    <Compile Include="Obsolete\UWP\**\*.cs" />
     <EmbeddedResource Include="Obsolete\UWP\Strings_PlatformServices.resx" />
     <Compile Include="..\..\src\System.Reactive.For.WindowsRuntime\AsyncInfoExtensions.cs" Link="Obsolete\UWP\AsyncInfoExtensions.cs" />
+
+    <ProjectReference Include="..\..\src\System.Reactive.For.WindowsRuntime\System.Reactive.For.WindowsRuntime.csproj" />
   </ItemGroup>
 
+  <!-- Windows Forms -->
+  <ItemGroup Condition="'$(TargetFramework)' == 'net472' or $(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net8.0-windows')) or $(TargetFramework.StartsWith('net9.0-windows'))">
+    <ProjectReference Include="..\..\src\System.Reactive.For.WindowsForms\System.Reactive.For.WindowsForms.csproj" />
+  </ItemGroup>
+  
   <!-- Windows includes for Desktop and UWP -->
   <ItemGroup Condition=" '$(TargetFramework)' == 'net472' or $(TargetFramework.StartsWith('uap10.0')) or $(TargetFramework.StartsWith('net6.0-windows')) or $(TargetFramework.StartsWith('net7.0-windows'))">
     <Compile Include="Obsolete\Windows\**\*.cs" />
@@ -87,6 +100,7 @@
     <ProjectReference Include="..\..\src\System.Reactive.Net\System.Reactive.Net.csproj">
       <Aliases>SystemReactiveNet</Aliases>
     </ProjectReference>
+
     <ProjectReference Condition="('$(TargetFramework)' == 'net472') or $(TargetFramework.StartsWith('net6.0-windows'))" Include="..\..\src\System.Reactive.For.WindowsForms\System.Reactive.For.WindowsForms.csproj" />
   </ItemGroup>
 
@@ -94,4 +108,8 @@
     <ReferencePath Include="$(TargetPlatformSdkPath)UnionMetadata\10.0.19041.0\Windows.winmd" />
   </ItemGroup>
 
+  <ItemGroup>
+    <Folder Include="Obsolete\UWP\Linq\" />
+  </ItemGroup>
+
 </Project>

+ 5 - 1
Rx.NET/Source/facades/System.Reactive/System/Reactive.cs

@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
@@ -31,3 +31,7 @@ using System.Runtime.CompilerServices;
 [assembly:TypeForwardedToAttribute(typeof(Timestamped<>))]
 [assembly:TypeForwardedToAttribute(typeof(Timestamped))]
 [assembly:TypeForwardedToAttribute(typeof(Unit))]
+
+#if WINDOWS
+[assembly: TypeForwardedToAttribute(typeof(System.Reactive.IEventPatternSource<,>))]
+#endif

+ 7 - 7
Rx.NET/Source/facades/System.Reactive/System/Reactive/Concurrency.cs

@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
@@ -60,12 +60,12 @@ using System.Runtime.CompilerServices;
 // deprecating them. This would enable us to avoid making working types obsolete which might reduce confusion.
 // It does remove the opportunity to fix up some naming issues, but maybe it would be better to live with that
 // to minimize disruption.
-//#if WINDOWS
-//[assembly:TypeForwardedToAttribute(typeof(CoreDispatcherScheduler))]
-//#endif
-//#if HAS_WINFORMS
-//[assembly:TypeForwardedToAttribute(typeof(ControlScheduler))]
-//#endif
+#if WINDOWS
+[assembly:TypeForwardedToAttribute(typeof(System.Reactive.Concurrency.CoreDispatcherScheduler))]
+#endif
+#if HAS_WINFORMS
+[assembly:TypeForwardedToAttribute(typeof(System.Reactive.Concurrency.ControlScheduler))]
+#endif
 //#if HAS_DISPATCHER
 //[assembly:TypeForwardedToAttribute(typeof(DispatcherScheduler))]
 //#endif

+ 9 - 8
Rx.NET/Source/facades/System.Reactive/System/Reactive/Linq.cs

@@ -1,4 +1,4 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
@@ -18,14 +18,15 @@ using System.Runtime.CompilerServices;
 [assembly:TypeForwardedToAttribute(typeof(Qbservable))]
 [assembly:TypeForwardedToAttribute(typeof(QbservableEx))]
 [assembly:TypeForwardedToAttribute(typeof(QueryDebugger))]
-//#if WINDOWS
+
+#if WINDOWS
 //[assembly:TypeForwardedToAttribute(typeof(AsyncInfoObservable))]
-//[assembly:TypeForwardedToAttribute(typeof(CoreDispatcherObservable))]
-//[assembly:TypeForwardedToAttribute(typeof(WindowsObservable))]
-//#endif
-//#if HAS_WINFORMS
-//[assembly:TypeForwardedToAttribute(typeof(ControlObservable))]
-//#endif
+[assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.CoreDispatcherObservable))]
+[assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.WindowsObservable))]
+#endif
+#if HAS_WINFORMS
+[assembly:TypeForwardedToAttribute(typeof(System.Reactive.Linq.ControlObservable))]
+#endif
 //#if HAS_DISPATCHER
 //[assembly:TypeForwardedToAttribute(typeof(DispatcherObservable))]
 //#endif

+ 6 - 6
Rx.NET/Source/facades/System.Reactive/System/Reactive/Windows/Foundation.cs

@@ -1,12 +1,12 @@
-// Licensed to the .NET Foundation under one or more agreements.
+// Licensed to the .NET Foundation under one or more agreements.
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
-////#if WINDOWS
+#if WINDOWS
 
-////using System.Reactive.Windows.Foundation;
 
-////using System.Runtime.CompilerServices;
+using System.Runtime.CompilerServices;
 
-////[assembly:TypeForwardedToAttribute(typeof(AsyncInfoObservableExtensions))]
-////#endif
+[assembly:TypeForwardedToAttribute(typeof(System.Reactive.Windows.Foundation.AsyncInfoObservableExtensions))]
+
+#endif

+ 2 - 3
Rx.NET/Source/src/System.Reactive.For.WindowsForms/ControlScheduler.cs

@@ -2,12 +2,11 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information.
 
-using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Threading;
 using System.Windows.Forms;
 
-namespace System.Reactive.WindowsForms
+namespace System.Reactive.Concurrency
 {
     /// <summary>
     /// Represents an object that schedules units of work on the message loop associated with a Windows Forms control.
@@ -22,7 +21,7 @@ namespace System.Reactive.WindowsForms
         /// <param name="control">Windows Forms control to get the message loop from.</param>
         /// <exception cref="ArgumentNullException"><paramref name="control"/> is null.</exception>
         /// <remarks>
-        /// This scheduler type is typically used indirectly through the <see cref="Linq.WindowsFormsControlObservable.ObserveOnWindowsFormsControl{TSource}"/> and <see cref="Linq.WindowsFormsControlObservable.SubscribeOnWindowFormsControl{TSource}"/> method overloads that take a Windows Forms control.
+        /// This scheduler type is typically used indirectly through the <see cref="Linq.ControlObservable.ObserveOn{TSource}"/> and <see cref="Linq.ControlObservable.SubscribeOn{TSource}"/> method overloads that take a Windows Forms control.
         /// </remarks>
         public ControlScheduler(Control control)
         {

+ 5 - 13
Rx.NET/Source/src/System.Reactive.For.WindowsForms/System.Reactive.Linq/WindowsFormsControlObservable.cs → Rx.NET/Source/src/System.Reactive.For.WindowsForms/System.Reactive.Linq/ControlObservable.cs

@@ -2,23 +2,15 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
+using System.Reactive.Concurrency;
 using System.Windows.Forms;
 
-using ControlScheduler = System.Reactive.WindowsForms.ControlScheduler;
-using Synchronization = System.Reactive.Concurrency.Synchronization;
-
 namespace System.Reactive.Linq
 {
     /// <summary>
     /// Provides a set of static methods for subscribing to IObservables using Windows Forms controls.
     /// </summary>
-    /// <remarks>
-    /// <para>
-    /// This replaces the obsolete <c>System.Reactive.Linq.ControlObservable</c> class in
-    /// <c>System.Reactive</c>.
-    /// </para>
-    /// </remarks>
-    public static class WindowsFormsControlObservable
+    public static class ControlObservable
     {
         /// <summary>
         /// Wraps the source sequence in order to run its subscription and unsubscription logic on the Windows Forms message loop associated with the specified control.
@@ -30,9 +22,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="control"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified control.
-        /// In order to invoke observer callbacks on the specified control, e.g. to render results in a control, use <see cref="ObserveOnWindowsFormsControl"/>.
+        /// In order to invoke observer callbacks on the specified control, e.g. to render results in a control, use <see cref="ObserveOn"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnWindowFormsControl<TSource>(this IObservable<TSource> source, Control control)
+        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, Control control)
         {
             if (source == null)
             {
@@ -55,7 +47,7 @@ namespace System.Reactive.Linq
         /// <param name="control">Windows Forms control whose associated message loop is used to notify observers on.</param>
         /// <returns>The source sequence whose observations happen on the Windows Forms message loop associated with the specified control.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="control"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnWindowsFormsControl<TSource>(this IObservable<TSource> source, Control control)
+        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, Control control)
         {
             if (source == null)
             {

+ 5 - 1
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/AsyncInfoObservableExtensions.cs

@@ -2,10 +2,13 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
+#if HAS_WINRT
 using System.Reactive.Linq;
+using System.Reactive.WindowsRuntime;
+
 using Windows.Foundation;
 
-namespace System.Reactive.WindowsRuntime
+namespace System.Reactive.Windows.Foundation
 {
     /// <summary>
     /// Provides conversions from Windows Runtime asynchronous actions and operations to observable sequences.
@@ -274,3 +277,4 @@ namespace System.Reactive.WindowsRuntime
         #endregion
     }
 }
+#endif

+ 12 - 8
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/CoreDispatcherScheduler.cs

@@ -2,21 +2,24 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
+#if WINDOWS
 using System.Reactive.Disposables;
-using System.Reactive.Concurrency;
 using System.Runtime.ExceptionServices;
 using System.Threading;
+
 using Windows.System;
 using Windows.UI.Core;
+#if HAS_OS_XAML
+using Windows.UI.Xaml;
+#endif
 
-namespace System.Reactive.WindowsRuntime
+namespace System.Reactive.Concurrency
 {
     /// <summary>
-    /// Schedules units of work on a <see cref="CoreDispatcher"/>.
+    /// Represents an object that schedules units of work on a <see cref="CoreDispatcher"/>.
     /// </summary>
     /// <remarks>
-    /// This scheduler type is typically used indirectly through the extension methods defined by
-    /// <see cref="Linq.WindowsRuntimeCoreDispatcherObservable"/>.
+    /// This scheduler type is typically used indirectly through the <see cref="Linq.CoreDispatcherObservable.ObserveOnCoreDispatcher{TSource}(IObservable{TSource})"/> and <see cref="Linq.CoreDispatcherObservable.SubscribeOnCoreDispatcher{TSource}(IObservable{TSource})"/> methods that use the current CoreDispatcher.
     /// </remarks>
     [CLSCompliant(false)]
     public sealed class CoreDispatcherScheduler : LocalScheduler, ISchedulerPeriodic
@@ -107,7 +110,7 @@ namespace System.Reactive.WindowsRuntime
                         // For scheduler implementation guidance rules, see TaskPoolScheduler.cs
                         // in System.Reactive.PlatformServices\Reactive\Concurrency.
                         //
-                        
+
                         var timer = CreateDispatcherQueue().CreateTimer();
                         timer.Interval = TimeSpan.Zero;
 
@@ -130,12 +133,12 @@ namespace System.Reactive.WindowsRuntime
 
         private DispatcherQueue CreateDispatcherQueue()
         {
-            if(_dispatcherQueue != null)
+            if (_dispatcherQueue != null)
             {
                 return _dispatcherQueue;
             }
 
-            if(Dispatcher.HasThreadAccess)
+            if (Dispatcher.HasThreadAccess)
             {
                 _dispatcherQueue = DispatcherQueue.GetForCurrentThread();
                 return _dispatcherQueue;
@@ -264,3 +267,4 @@ namespace System.Reactive.WindowsRuntime
         }
     }
 }
+#endif

+ 3 - 3
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/EventPatternSource.cs

@@ -4,16 +4,16 @@
 
 using Windows.Foundation;
 
-namespace System.Reactive.WindowsRuntime
+namespace System.Reactive
 {
-    internal sealed class EventPatternSource<TSender, TEventArgs> : EventPatternSourceBase<TSender, TEventArgs>, ITypedEventPatternSource<TSender, TEventArgs>
+    internal sealed class EventPatternSource<TSender, TEventArgs> : EventPatternSourceBase<TSender, TEventArgs>, IEventPatternSource<TSender, TEventArgs>
     {
         public EventPatternSource(IObservable<EventPattern<TSender, TEventArgs>> source, Action<Action<TSender, TEventArgs>, /*object,*/ EventPattern<TSender, TEventArgs>> invokeHandler)
             : base(source, invokeHandler)
         {
         }
 
-        event TypedEventHandler<TSender, TEventArgs> ITypedEventPatternSource<TSender, TEventArgs>.OnNext
+        event TypedEventHandler<TSender, TEventArgs> IEventPatternSource<TSender, TEventArgs>.OnNext
         {
             add
             {

+ 24 - 0
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/IEventPatternSource.cs

@@ -0,0 +1,24 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT License.
+// See the LICENSE file in the project root for more information. 
+
+using Windows.Foundation;
+
+namespace System.Reactive
+{
+    /// <summary>
+    /// Represents a data stream signaling its elements by means of an event.
+    /// </summary>
+    /// <typeparam name="TSender">Sender type.</typeparam>
+    /// <typeparam name="TEventArgs">Event arguments type.</typeparam>
+    [CLSCompliant(false)]
+    public interface IEventPatternSource<TSender, TEventArgs>
+    {
+        /// <summary>
+        /// Event signaling the next element in the data stream.
+        /// </summary>
+#pragma warning disable CA1003 // (Use generic EventHandler.) The use of the Windows.Foundation handler type is by design
+        event TypedEventHandler<TSender, TEventArgs> OnNext;
+#pragma warning restore CA1003
+    }
+}

+ 1 - 1
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/StableCompositeDisposable.cs

@@ -11,7 +11,7 @@ namespace System.Reactive.WindowsRuntime
     /// </summary>
     /// <remarks>
     /// This is a copy from <c>System.Reactive</c> and then trimmed down to provide just the one
-    /// feature <see cref="System.Reactive.Linq.WindowsRuntimeAsyncInfoObservable"/>
+    /// feature <see cref="Linq.AsyncInfoObservable"/>
     /// needs: access to the internal CreateTrusted method. I didn't want to make that a
     /// public-facing part of the main library. (And <c>InternalsVisibleTo</c> effectively makes it
     /// somewhat public: it means changes to the internals could break this library.) Better, then

+ 13 - 12
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsRuntimeAsyncInfoObservable.cs → Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/AsyncInfoObservable.cs

@@ -2,20 +2,21 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
+using System.Reactive.Disposables;
 using System.Reactive.Threading.Tasks;
 using System.Reactive.WindowsRuntime;
 using System.Runtime.InteropServices.WindowsRuntime;
 using System.Threading.Tasks;
+
 using Windows.Foundation;
 
 namespace System.Reactive.Linq
 {
     /// <summary>
-    /// Provides a set of extension methods to expose observable sequences as Windows Runtime
-    /// asynchronous actions and operations.
+    /// Provides a set of extension methods to expose observable sequences as Windows Runtime asynchronous actions and operations.
     /// </summary>
     [CLSCompliant(false)]
-    public static class WindowsRuntimeAsyncInfoObservable
+    public static class AsyncInfoObservable
     {
         #region IAsyncAction
 
@@ -27,7 +28,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence to expose as an asynchronous action.</param>
         /// <returns>Windows Runtime asynchronous action object representing the completion of the observable sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IAsyncAction ToIAsyncAction<TSource>(this IObservable<TSource> source)
+        public static IAsyncAction ToAsyncAction<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
             {
@@ -47,7 +48,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence to expose as an asynchronous action.</param>
         /// <returns>Windows Runtime asynchronous action object representing the completion of the observable sequence, reporting incremental progress for each source sequence element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IAsyncActionWithProgress<int> ToIAsyncActionWithProgress<TSource>(this IObservable<TSource> source)
+        public static IAsyncActionWithProgress<int> ToAsyncActionWithProgress<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
             {
@@ -71,7 +72,7 @@ namespace System.Reactive.Linq
         /// <param name="progressSelector">Selector function to map the source sequence on a progress reporting sequence.</param>
         /// <returns>Windows Runtime asynchronous action object representing the completion of the result sequence, reporting progress computed through the progress sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="progressSelector"/> is null.</exception>
-        public static IAsyncActionWithProgress<TProgress> ToIAsyncActionWithProgress<TSource, TProgress>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TProgress>> progressSelector)
+        public static IAsyncActionWithProgress<TProgress> ToAsyncActionWithProgress<TSource, TProgress>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TProgress>> progressSelector)
         {
             if (source == null)
             {
@@ -95,7 +96,7 @@ namespace System.Reactive.Linq
                     var dataSubscription = data.DefaultIfEmpty().Subscribe(obs);
                     var connection = data.Connect();
 
-                    return StableUncheckedCompositeDisposable.CreateTrusted(progressSubscription, dataSubscription, connection);
+                    return StableCompositeDisposable.CreateTrusted(progressSubscription, dataSubscription, connection);
                 }).ToTask(ct);
             });
         }
@@ -114,7 +115,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence to expose as an asynchronous operation.</param>
         /// <returns>Windows Runtime asynchronous operation object that returns the last element of the observable sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IAsyncOperation<TSource> ToIAsyncOperation<TSource>(this IObservable<TSource> source)
+        public static IAsyncOperation<TSource> ToAsyncOperation<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
             {
@@ -132,7 +133,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence to expose as an asynchronous operation.</param>
         /// <returns>Windows Runtime asynchronous operation object that returns the last element of the observable sequence, reporting incremental progress for each source sequence element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IAsyncOperationWithProgress<TSource, int> ToIAsyncOperationWithProgress<TSource>(this IObservable<TSource> source)
+        public static IAsyncOperationWithProgress<TSource, int> ToAsyncOperationWithProgress<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
             {
@@ -158,7 +159,7 @@ namespace System.Reactive.Linq
         /// <param name="resultSelector">Selector function to map the source sequence on a result sequence.</param>
         /// <returns>Windows Runtime asynchronous operation object that returns the last element of the result sequence, reporting incremental progress for each source sequence element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="resultSelector"/> is null.</exception>
-        public static IAsyncOperationWithProgress<TResult, int> ToIAsyncOperationWithProgress<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> resultSelector)
+        public static IAsyncOperationWithProgress<TResult, int> ToAsyncOperationWithProgress<TSource, TResult>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> resultSelector)
         {
             if (source == null)
             {
@@ -189,7 +190,7 @@ namespace System.Reactive.Linq
         /// <param name="progressSelector">Selector function to map the source sequence on a progress reporting sequence.</param>
         /// <returns>Windows Runtime asynchronous operation object that returns the last element of the result sequence, reporting progress computed through the progress sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="resultSelector"/> or <paramref name="progressSelector"/> is null.</exception>
-        public static IAsyncOperationWithProgress<TResult, TProgress> ToIAsyncOperationWithProgress<TSource, TResult, TProgress>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> resultSelector, Func<IObservable<TSource>, IObservable<TProgress>> progressSelector)
+        public static IAsyncOperationWithProgress<TResult, TProgress> ToAsyncOperationWithProgress<TSource, TResult, TProgress>(this IObservable<TSource> source, Func<IObservable<TSource>, IObservable<TResult>> resultSelector, Func<IObservable<TSource>, IObservable<TProgress>> progressSelector)
         {
             if (source == null)
             {
@@ -218,7 +219,7 @@ namespace System.Reactive.Linq
                     var dataSubscription = resultSelector(data).Subscribe(obs);
                     var connection = data.Connect();
 
-                    return StableUncheckedCompositeDisposable.CreateTrusted(progressSubscription, dataSubscription, connection);
+                    return StableCompositeDisposable.CreateTrusted(progressSubscription, dataSubscription, connection);
                 }).ToTask(ct);
             });
         }

+ 24 - 23
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsRuntimeCoreDispatcherObservable.cs → Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/CoreDispatcherObservable.cs

@@ -2,24 +2,24 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
+#if WINDOWS
+using System.Reactive.Concurrency;
+
 using Windows.UI.Core;
 
 #if HAS_OS_XAML
 using Windows.UI.Xaml;
 #endif
 
-using CoreDispatcherScheduler = System.Reactive.WindowsRuntime.CoreDispatcherScheduler;
-using Synchronization = System.Reactive.Concurrency.Synchronization;
-
 namespace System.Reactive.Linq
 {
     /// <summary>
     /// Provides a set of extension methods for scheduling actions performed through observable sequences on UI dispatchers.
     /// </summary>
     [CLSCompliant(false)]
-    public static class WindowsRuntimeCoreDispatcherObservable
+    public static class CoreDispatcherObservable
     {
-        #region ObserveOn[Current]CoreDispatcher
+        #region ObserveOn[CoreDispatcher]
 
         /// <summary>
         /// Wraps the source sequence in order to run its observer callbacks on the specified dispatcher.
@@ -29,7 +29,7 @@ namespace System.Reactive.Linq
         /// <param name="dispatcher">Dispatcher whose associated message loop is used to notify observers on.</param>
         /// <returns>The source sequence whose observations happen on the specified dispatcher.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
+        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
         {
             if (source == null)
             {
@@ -53,7 +53,7 @@ namespace System.Reactive.Linq
         /// <param name="priority">Priority to schedule work items at.</param>
         /// <returns>The source sequence whose observations happen on the specified dispatcher.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
+        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
         {
             if (source == null)
             {
@@ -77,7 +77,7 @@ namespace System.Reactive.Linq
         /// <param name="dependencyObject">Object to get the dispatcher from.</param>
         /// <returns>The source sequence whose observations happen on the specified object's dispatcher.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
+        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
         {
             if (source == null)
             {
@@ -101,7 +101,7 @@ namespace System.Reactive.Linq
         /// <param name="priority">Priority to schedule work items at.</param>
         /// <returns>The source sequence whose observations happen on the specified object's dispatcher.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
+        public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
         {
             if (source == null)
             {
@@ -123,7 +123,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence.</param>
         /// <returns>The source sequence whose observations happen on the current window's dispatcher.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnCurrentWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source)
+        public static IObservable<TSource> ObserveOnCoreDispatcher<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
             {
@@ -141,7 +141,7 @@ namespace System.Reactive.Linq
         /// <param name="priority">Priority to schedule work items at.</param>
         /// <returns>The source sequence whose observations happen on the current window's dispatcher.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static IObservable<TSource> ObserveOnCurrentWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
+        public static IObservable<TSource> ObserveOnDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
         {
             if (source == null)
             {
@@ -165,9 +165,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher.
-        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="WindowsRuntimeCoreDispatcherObservable.ObserveOnWindowsRuntimeCoreDispatcher{TSource}(IObservable{TSource}, CoreDispatcher)"/>.
+        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, CoreDispatcher)"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
+        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
         {
             if (source == null)
             {
@@ -193,9 +193,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dispatcher"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the specified dispatcher.
-        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="WindowsRuntimeCoreDispatcherObservable.ObserveOnWindowsRuntimeCoreDispatcher{TSource}(IObservable{TSource}, CoreDispatcher, CoreDispatcherPriority)"/>.
+        /// In order to invoke observer callbacks on the specified dispatcher, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, CoreDispatcher, CoreDispatcherPriority)"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
+        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
         {
             if (source == null)
             {
@@ -221,9 +221,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the specified object.
-        /// In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use <see cref="WindowsRuntimeCoreDispatcherObservable.ObserveOnWindowsRuntimeCoreDispatcher{TSource}(IObservable{TSource}, DependencyObject)"/>.
+        /// In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, DependencyObject)"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
+        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
         {
             if (source == null)
             {
@@ -249,9 +249,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="dependencyObject"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the specified object.
-        /// In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use <see cref="WindowsRuntimeCoreDispatcherObservable.ObserveOnWindowsRuntimeCoreDispatcher{TSource}(IObservable{TSource}, DependencyObject, CoreDispatcherPriority)"/>.
+        /// In order to invoke observer callbacks on the dispatcher associated with the specified object, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOn{TSource}(IObservable{TSource}, DependencyObject, CoreDispatcherPriority)"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
+        public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
         {
             if (source == null)
             {
@@ -276,9 +276,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the current window.
-        /// In order to invoke observer callbacks on the dispatcher associated with the current window, e.g. to render results in a control, use <see cref="WindowsRuntimeCoreDispatcherObservable.ObserveOnCurrentWindowsRuntimeCoreDispatcher{TSource}(IObservable{TSource})"/>.
+        /// In order to invoke observer callbacks on the dispatcher associated with the current window, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOnCoreDispatcher{TSource}(IObservable{TSource})"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnCurrentWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source)
+        public static IObservable<TSource> SubscribeOnCoreDispatcher<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
             {
@@ -298,9 +298,9 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <remarks>
         /// Only the side-effects of subscribing to the source sequence and disposing subscriptions to the source sequence are run on the dispatcher associated with the current window.
-        /// In order to invoke observer callbacks on the dispatcher associated with the current window, e.g. to render results in a control, use <see cref="WindowsRuntimeCoreDispatcherObservable.ObserveOnCurrentWindowsRuntimeCoreDispatcher{TSource}(IObservable{TSource}, CoreDispatcherPriority)"/>.
+        /// In order to invoke observer callbacks on the dispatcher associated with the current window, e.g. to render results in a control, use <see cref="CoreDispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource}, CoreDispatcherPriority)"/>.
         /// </remarks>
-        public static IObservable<TSource> SubscribeOnCurrentWindowsRuntimeCoreDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
+        public static IObservable<TSource> SubscribeOnDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
         {
             if (source == null)
             {
@@ -313,3 +313,4 @@ namespace System.Reactive.Linq
         #endregion
     }
 }
+#endif

+ 9 - 5
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsRuntimeObservable.Events.cs → Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsObservable.Events.cs

@@ -2,6 +2,9 @@
 // The .NET Foundation licenses this file to you under the MIT License.
 // See the LICENSE file in the project root for more information. 
 
+#if HAS_WINRT
+using System.Reactive.WindowsRuntime;
+
 using Windows.Foundation;
 
 namespace System.Reactive.Linq
@@ -10,7 +13,7 @@ namespace System.Reactive.Linq
     /// Provides a set of static methods for importing typed events from Windows Runtime APIs.
     /// </summary>
     [CLSCompliant(false)]
-    public static partial class WindowsRuntimeObservable
+    public static partial class WindowsObservable
     {
         /// <summary>
         /// Converts a typed event, conforming to the standard event pattern, to an observable sequence.
@@ -21,7 +24,7 @@ namespace System.Reactive.Linq
         /// <param name="removeHandler">Action that detaches the given event handler from the underlying .NET event.</param>
         /// <returns>The observable sequence that contains data representations of invocations of the underlying typed event.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="addHandler"/> or <paramref name="removeHandler"/> is null.</exception>
-        /// <seealso cref="ToWindowsFoundationEventPattern"/>
+        /// <seealso cref="ToEventPattern"/>
         public static IObservable<EventPattern<TSender, TResult>> FromEventPattern<TSender, TResult>(Action<TypedEventHandler<TSender, TResult>> addHandler, Action<TypedEventHandler<TSender, TResult>> removeHandler)
         {
             if (addHandler == null)
@@ -61,7 +64,7 @@ namespace System.Reactive.Linq
         /// <param name="removeHandler">Action that detaches the given event handler from the underlying .NET event.</param>
         /// <returns>The observable sequence that contains data representations of invocations of the underlying typed event.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="conversion"/> or <paramref name="addHandler"/> or <paramref name="removeHandler"/> is null.</exception>
-        /// <seealso cref="ToWindowsFoundationEventPattern"/>
+        /// <seealso cref="ToEventPattern"/>
         public static IObservable<EventPattern<TSender, TResult>> FromEventPattern<TDelegate, TSender, TResult>(Func<TypedEventHandler<TSender, TResult>, TDelegate> conversion, Action<TDelegate> addHandler, Action<TDelegate> removeHandler)
         {
             if (conversion == null)
@@ -103,14 +106,15 @@ namespace System.Reactive.Linq
         /// <param name="source">Observable source sequence.</param>
         /// <returns>The event source object.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        public static System.Reactive.WindowsRuntime.ITypedEventPatternSource<TSender, TEventArgs> ToWindowsFoundationEventPattern<TSender, TEventArgs>(this IObservable<EventPattern<TSender, TEventArgs>> source)
+        public static IEventPatternSource<TSender, TEventArgs> ToEventPattern<TSender, TEventArgs>(this IObservable<EventPattern<TSender, TEventArgs>> source)
         {
             if (source == null)
             {
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return new System.Reactive.WindowsRuntime.EventPatternSource<TSender, TEventArgs>(source, static (h, evt) => h(evt.Sender!, evt.EventArgs));
+            return new EventPatternSource<TSender, TEventArgs>(source, static (h, evt) => h(evt.Sender!, evt.EventArgs));
         }
     }
 }
+#endif

+ 1 - 7
Rx.NET/Source/facades/System.Reactive/Obsolete/UWP/Linq/WindowsObservable.StandardSequenceOperators.cs → Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsObservable.StandardSequenceOperators.cs

@@ -3,10 +3,8 @@
 // See the LICENSE file in the project root for more information. 
 
 #if HAS_WINRT
-extern alias SystemReactiveNet;
-using SystemReactiveNet::System.Reactive.Linq;
-
 using System.Reactive.Windows.Foundation;
+
 using Windows.Foundation;
 
 namespace System.Reactive.Linq
@@ -23,7 +21,6 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence whose elements are the result of the asynchronous operations executed for each element of the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <remarks>This overload supports composition of observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        [Obsolete("Use the SelectManyIAsyncOperation extension method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
         public static IObservable<TResult> SelectMany<TSource, TResult>(this IObservable<TSource> source, Func<TSource, IAsyncOperation<TResult>> selector)
         {
             if (source == null)
@@ -50,7 +47,6 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence whose elements are the result of the asynchronous operations executed for each element of the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <remarks>This overload supports composition of observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        [Obsolete("Use the SelectManyIAsyncOperationWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
         public static IObservable<TResult> SelectMany<TSource, TResult, TProgress>(this IObservable<TSource> source, Func<TSource, IAsyncOperationWithProgress<TResult, TProgress>> selector)
         {
             if (source == null)
@@ -78,7 +74,6 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence whose elements are the result of obtaining an asynchronous operation for each element of the input sequence and then mapping the asynchronous operation's result and its corresponding source element to a result element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="asyncOperationSelector"/> or <paramref name="resultSelector"/> is null.</exception>
         /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        [Obsolete("Use the SelectManyIAsyncOperation extension method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
         public static IObservable<TResult> SelectMany<TSource, TAsyncOperationResult, TResult>(this IObservable<TSource> source, Func<TSource, IAsyncOperation<TAsyncOperationResult>> asyncOperationSelector, Func<TSource, TAsyncOperationResult, TResult> resultSelector)
         {
             if (source == null)
@@ -112,7 +107,6 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence whose elements are the result of obtaining an asynchronous operation for each element of the input sequence and then mapping the asynchronous operation's result and its corresponding source element to a result element.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="asyncOperationSelector"/> or <paramref name="resultSelector"/> is null.</exception>
         /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        [Obsolete("Use the SelectManyIAsyncOperationWithProgress extension method defined by System.Reactive.Linq.WindowsRuntimeObservable in the System.Reactive.For.WindowsRuntime package instead", error: false)]
         public static IObservable<TResult> SelectMany<TSource, TAsyncOperationResult, TAsyncOperationProgress, TResult>(this IObservable<TSource> source, Func<TSource, IAsyncOperationWithProgress<TAsyncOperationResult, TAsyncOperationProgress>> asyncOperationSelector, Func<TSource, TAsyncOperationResult, TResult> resultSelector)
         {
             if (source == null)

+ 0 - 135
Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/System.Reactive.Linq/WindowsRuntimeObservable.StandardSequenceOperators.cs

@@ -1,135 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// The .NET Foundation licenses this file to you under the MIT License.
-// See the LICENSE file in the project root for more information. 
-
-using System.Reactive.WindowsRuntime;
-using Windows.Foundation;
-
-namespace System.Reactive.Linq
-{
-    public static partial class WindowsRuntimeObservable
-    {
-        /// <summary>
-        /// Projects each element of an observable sequence to a Windows Runtime asynchronous operation and merges all of the asynchronous operation results into one observable sequence.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TResult">The type of the result produced by the projected asynchronous operations and the elements in the merged result sequence.</typeparam>
-        /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence whose elements are the result of the asynchronous operations executed for each element of the input sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <remarks>
-        /// <para>
-        /// This overload supports composition of observable sequences and Windows Runtime
-        /// asynchronous operations, without requiring manual conversion of the asynchronous
-        /// operations to observable sequences using
-        /// <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.
-        /// </para>
-        /// </remarks>
-        public static IObservable<TResult> SelectManyIAsyncOperation<TSource, TResult>(this IObservable<TSource> source, Func<TSource, IAsyncOperation<TResult>> selector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (selector == null)
-            {
-                throw new ArgumentNullException(nameof(selector));
-            }
-
-            return source.SelectMany(x => selector(x).ToObservable());
-        }
-
-        /// <summary>
-        /// Projects each element of an observable sequence to a Windows Runtime asynchronous operation and merges all of the asynchronous operation results into one observable sequence.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TResult">The type of the result produced by the projected asynchronous operations and the elements in the merged result sequence.</typeparam>
-        /// <typeparam name="TProgress">The type of the reported progress objects, which get ignored by this query operator.</typeparam>
-        /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence whose elements are the result of the asynchronous operations executed for each element of the input sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <remarks>This overload supports composition of observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        public static IObservable<TResult> SelectManyIAsyncOperationWithProgress<TSource, TResult, TProgress>(this IObservable<TSource> source, Func<TSource, IAsyncOperationWithProgress<TResult, TProgress>> selector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (selector == null)
-            {
-                throw new ArgumentNullException(nameof(selector));
-            }
-
-            return source.SelectMany(x => selector(x).ToObservable());
-        }
-
-        /// <summary>
-        /// Projects each element of an observable sequence to a Windows Runtime asynchronous operation, invokes the result selector for the source element and the asynchronous operation result, and merges the results into one observable sequence.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TAsyncOperationResult">The type of the results produced by the projected asynchronous operations.</typeparam>
-        /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate asynchronous operation results.</typeparam>
-        /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="asyncOperationSelector">A transform function to apply to each element.</param>
-        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
-        /// <returns>An observable sequence whose elements are the result of obtaining an asynchronous operation for each element of the input sequence and then mapping the asynchronous operation's result and its corresponding source element to a result element.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="asyncOperationSelector"/> or <paramref name="resultSelector"/> is null.</exception>
-        /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        public static IObservable<TResult> SelectManyIAsyncOperation<TSource, TAsyncOperationResult, TResult>(this IObservable<TSource> source, Func<TSource, IAsyncOperation<TAsyncOperationResult>> asyncOperationSelector, Func<TSource, TAsyncOperationResult, TResult> resultSelector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (asyncOperationSelector == null)
-            {
-                throw new ArgumentNullException(nameof(asyncOperationSelector));
-            }
-
-            if (resultSelector == null)
-            {
-                throw new ArgumentNullException(nameof(resultSelector));
-            }
-
-            return source.SelectMany(x => asyncOperationSelector(x).ToObservable(), resultSelector);
-        }
-
-        /// <summary>
-        /// Projects each element of an observable sequence to a Windows Runtime asynchronous operation, invokes the result selector for the source element and the asynchronous operation result, and merges the results into one observable sequence.
-        /// </summary>
-        /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
-        /// <typeparam name="TAsyncOperationResult">The type of the results produced by the projected asynchronous operations.</typeparam>
-        /// <typeparam name="TAsyncOperationProgress">The type of the reported progress objects, which get ignored by this query operator.</typeparam>
-        /// <typeparam name="TResult">The type of the elements in the result sequence, obtained by using the selector to combine source sequence elements with their corresponding intermediate asynchronous operation results.</typeparam>
-        /// <param name="source">An observable sequence of elements to project.</param>
-        /// <param name="asyncOperationSelector">A transform function to apply to each element.</param>
-        /// <param name="resultSelector">A transform function to apply to each element of the intermediate sequence.</param>
-        /// <returns>An observable sequence whose elements are the result of obtaining an asynchronous operation for each element of the input sequence and then mapping the asynchronous operation's result and its corresponding source element to a result element.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="asyncOperationSelector"/> or <paramref name="resultSelector"/> is null.</exception>
-        /// <remarks>This overload supports using LINQ query comprehension syntax in C# and Visual Basic to compose observable sequences and Windows Runtime asynchronous operations, without requiring manual conversion of the asynchronous operations to observable sequences using <see cref="AsyncInfoObservableExtensions.ToObservable{TResult}(IAsyncOperation{TResult})"/>.</remarks>
-        public static IObservable<TResult> SelectManyIAsyncOperationWithProgress<TSource, TAsyncOperationResult, TAsyncOperationProgress, TResult>(this IObservable<TSource> source, Func<TSource, IAsyncOperationWithProgress<TAsyncOperationResult, TAsyncOperationProgress>> asyncOperationSelector, Func<TSource, TAsyncOperationResult, TResult> resultSelector)
-        {
-            if (source == null)
-            {
-                throw new ArgumentNullException(nameof(source));
-            }
-
-            if (asyncOperationSelector == null)
-            {
-                throw new ArgumentNullException(nameof(asyncOperationSelector));
-            }
-
-            if (resultSelector == null)
-            {
-                throw new ArgumentNullException(nameof(resultSelector));
-            }
-
-            return source.SelectMany(x => asyncOperationSelector(x).ToObservable(), resultSelector);
-        }
-    }
-}

+ 1 - 3
Rx.NET/Source/facades/System.Reactive/Obsolete/Windows/ThreadPoolTimerExtensions.cs → Rx.NET/Source/src/System.Reactive.For.WindowsRuntime/ThreadPoolTimerExtensions.cs

@@ -3,9 +3,7 @@
 // See the LICENSE file in the project root for more information. 
 
 #if WINDOWS
-extern alias SystemReactiveNet;
-
-using SystemReactiveNet::System.Reactive.Disposables;
+using System.Reactive.Disposables;
 using Windows.System.Threading;
 using Windows.Foundation;
 

+ 1 - 0
Rx.NET/Source/src/System.Reactive.Net/Properties/InternalsVisibleTo.cs

@@ -5,3 +5,4 @@
 [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Tests.System.Reactive, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f5cff058631087031f8350f30a36fa078027e5df2316b564352dc9eb7af7ce856016d3c5e9d058036fe73bb5c83987bd3fc0793fbe25d633cc4f37c2bd5f1d717cd2a81661bec08f0971dc6078e17bde372b89005e7738a0ebd501b896ca3e8315270ff64df7809dd912c372df61785a5085b3553b7872e39b1b1cc0ff5a6bc")]
 [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Tests.System.Reactive.Uwp.DeviceRunner, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f5cff058631087031f8350f30a36fa078027e5df2316b564352dc9eb7af7ce856016d3c5e9d058036fe73bb5c83987bd3fc0793fbe25d633cc4f37c2bd5f1d717cd2a81661bec08f0971dc6078e17bde372b89005e7738a0ebd501b896ca3e8315270ff64df7809dd912c372df61785a5085b3553b7872e39b1b1cc0ff5a6bc")]
 [assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Reactive, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f5cff058631087031f8350f30a36fa078027e5df2316b564352dc9eb7af7ce856016d3c5e9d058036fe73bb5c83987bd3fc0793fbe25d633cc4f37c2bd5f1d717cd2a81661bec08f0971dc6078e17bde372b89005e7738a0ebd501b896ca3e8315270ff64df7809dd912c372df61785a5085b3553b7872e39b1b1cc0ff5a6bc")]
+[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Reactive.For.WindowsRuntime, PublicKey=00240000048000009400000006020000002400005253413100040000010001008f5cff058631087031f8350f30a36fa078027e5df2316b564352dc9eb7af7ce856016d3c5e9d058036fe73bb5c83987bd3fc0793fbe25d633cc4f37c2bd5f1d717cd2a81661bec08f0971dc6078e17bde372b89005e7738a0ebd501b896ca3e8315270ff64df7809dd912c372df61785a5085b3553b7872e39b1b1cc0ff5a6bc")]

+ 1 - 0
Rx.NET/Source/src/System.Reactive.Net/System.Reactive.Net.csproj

@@ -1,5 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
+    <TargetFrameworks>netstandard2.0;net8.0</TargetFrameworks>
     <TargetFrameworks>netstandard2.0;net472;uap10.0.18362;net6.0;net6.0-windows10.0.19041</TargetFrameworks>
     <CopyLocalLockFileAssemblies>false</CopyLocalLockFileAssemblies>
     <PackageTags>Rx;Reactive;Extensions;Observable;LINQ;Events</PackageTags>