Browse Source

4.x: System.Reactive fix field names, type args, usings, operator infrastructure

akarnokd 7 years ago
parent
commit
880486b012
76 changed files with 1067 additions and 1095 deletions
  1. 4 4
      Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs
  2. 19 19
      Rx.NET/Source/src/System.Reactive/Concurrency/AsyncLock.cs
  3. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs
  4. 3 4
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs
  5. 16 16
      Rx.NET/Source/src/System.Reactive/Concurrency/CurrentThreadScheduler.cs
  6. 8 8
      Rx.NET/Source/src/System.Reactive/Concurrency/DefaultScheduler.cs
  7. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs
  8. 6 6
      Rx.NET/Source/src/System.Reactive/Concurrency/HistoricalScheduler.cs
  9. 9 9
      Rx.NET/Source/src/System.Reactive/Concurrency/ImmediateScheduler.cs
  10. 20 20
      Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs
  11. 2 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Async.cs
  12. 29 29
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Recursive.cs
  13. 6 6
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs
  14. 5 5
      Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.cs
  15. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs
  16. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.Windows.cs
  17. 1 2
      Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs
  18. 9 9
      Rx.NET/Source/src/System.Reactive/Concurrency/VirtualTimeScheduler.cs
  19. 10 10
      Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs
  20. 3 3
      Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.cs
  21. 3 3
      Rx.NET/Source/src/System.Reactive/Internal/HostLifecycleService.cs
  22. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/ImmutableList.cs
  23. 3 3
      Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProvider.cs
  24. 2 2
      Rx.NET/Source/src/System.Reactive/Internal/QueryServices.cs
  25. 3 1
      Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs
  26. 39 39
      Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs
  27. 20 20
      Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs
  28. 330 347
      Rx.NET/Source/src/System.Reactive/Joins/ActivePlan.cs
  29. 52 52
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Aggregates.cs
  30. 4 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Awaiter.cs
  31. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs
  32. 3 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Queryable.cs
  33. 43 53
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Amb.cs
  34. 51 62
      Rx.NET/Source/src/System.Reactive/Linq/Observable/AmbMany.cs
  35. 12 12
      Rx.NET/Source/src/System.Reactive/Linq/Observable/AutoConnect.cs
  36. 3 3
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs
  37. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Case.cs
  38. 51 51
      Rx.NET/Source/src/System.Reactive/Linq/Observable/ConcatMany.cs
  39. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Defer.cs
  40. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/FirstLastBlocking.cs
  41. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Multicast.cs
  42. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/RefCount.cs
  43. 4 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Repeat.cs
  44. 36 36
      Rx.NET/Source/src/System.Reactive/Linq/Observable/RepeatWhen.cs
  45. 58 58
      Rx.NET/Source/src/System.Reactive/Linq/Observable/RetryWhen.cs
  46. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/SkipUntil.cs
  47. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Take.cs
  48. 6 6
      Rx.NET/Source/src/System.Reactive/Linq/Observable/TakeLast.cs
  49. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/TakeLastBuffer.cs
  50. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/Observable/TakeUntil.cs
  51. 4 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable/TimeInterval.cs
  52. 2 3
      Rx.NET/Source/src/System.Reactive/Linq/Observable/ToObservable.cs
  53. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Using.cs
  54. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Zip.cs
  55. 2 0
      Rx.NET/Source/src/System.Reactive/Linq/ObservableEx.cs
  56. 2 0
      Rx.NET/Source/src/System.Reactive/Linq/Observable_.cs
  57. 3 1
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs
  58. 11 9
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Joins.cs
  59. 4 4
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.cs
  60. 3 1
      Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs
  61. 33 33
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs
  62. 20 20
      Rx.NET/Source/src/System.Reactive/ListObservable.cs
  63. 2 2
      Rx.NET/Source/src/System.Reactive/Notification.cs
  64. 4 4
      Rx.NET/Source/src/System.Reactive/ObservableQuery.cs
  65. 7 7
      Rx.NET/Source/src/System.Reactive/ObserverBase.cs
  66. 3 3
      Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Concurrency/ControlScheduler.cs
  67. 17 17
      Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Concurrency/DispatcherScheduler.cs
  68. 1 1
      Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/ControlObservable.cs
  69. 14 14
      Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/DispatcherObservable.cs
  70. 8 8
      Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/Observable.Remoting.cs
  71. 17 17
      Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/QueryLanguage.Remoting.cs
  72. 1 1
      Rx.NET/Source/src/System.Reactive/Platforms/UWP/Concurrency/CoreDispatcherScheduler.cs
  73. 3 3
      Rx.NET/Source/src/System.Reactive/Platforms/UWP/Linq/WindowsObservable.Events.cs
  74. 10 10
      Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
  75. 1 1
      Rx.NET/Source/src/System.Reactive/TimeInterval.cs
  76. 1 1
      Rx.NET/Source/src/System.Reactive/Timestamped.cs

+ 4 - 4
Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs

@@ -24,7 +24,7 @@ namespace System.Reactive
         private readonly Action<Exception> _onError;
         private readonly Action _onCompleted;
 
-        private int isStopped;
+        private int _isStopped;
 
         public AnonymousSafeObserver(Action<T> onNext, Action<Exception> onError, Action onCompleted)
         {
@@ -35,7 +35,7 @@ namespace System.Reactive
 
         public override void OnNext(T value)
         {
-            if (isStopped == 0)
+            if (_isStopped == 0)
             {
                 var __noError = false;
                 try
@@ -55,7 +55,7 @@ namespace System.Reactive
 
         public override void OnError(Exception error)
         {
-            if (Interlocked.Exchange(ref isStopped, 1) == 0)
+            if (Interlocked.Exchange(ref _isStopped, 1) == 0)
             {
                 using (this)
                 {
@@ -66,7 +66,7 @@ namespace System.Reactive
 
         public override void OnCompleted()
         {
-            if (Interlocked.Exchange(ref isStopped, 1) == 0)
+            if (Interlocked.Exchange(ref _isStopped, 1) == 0)
             {
                 using (this)
                 {

+ 19 - 19
Rx.NET/Source/src/System.Reactive/Concurrency/AsyncLock.cs

@@ -11,10 +11,10 @@ namespace System.Reactive.Concurrency
     /// </summary>
     public sealed class AsyncLock : IDisposable
     {
-        private bool isAcquired;
-        private bool hasFaulted;
-        private readonly object guard = new object();
-        private Queue<(Action<Delegate, object> action, Delegate @delegate, object state)> queue;
+        private bool _isAcquired;
+        private bool _hasFaulted;
+        private readonly object _guard = new object();
+        private Queue<(Action<Delegate, object> action, Delegate @delegate, object state)> _queue;
 
         /// <summary>
         /// Queues the action for execution. If the caller acquires the lock and becomes the owner,
@@ -56,24 +56,24 @@ namespace System.Reactive.Concurrency
         private void Wait(object state, Delegate @delegate, Action<Delegate, object> action)
         {
             // allow one thread to update the state
-            lock (guard)
+            lock (_guard)
             {
                 // if a previous action crashed, ignore any future actions
-                if (hasFaulted)
+                if (_hasFaulted)
                 {
                     return;
                 }
 
                 // if the "lock" is busy, queue up the extra work
                 // otherwise there is no need to queue up "action"
-                if (isAcquired)
+                if (_isAcquired)
                 {
                     // create the queue if necessary
-                    var q = queue;
+                    var q = _queue;
                     if (q == null)
                     {
                         q = new Queue<(Action<Delegate, object> action, Delegate @delegate, object state)>();
-                        queue = q;
+                        _queue = q;
                     }
                     // enqueue the work
                     q.Enqueue((action, @delegate, state));
@@ -81,7 +81,7 @@ namespace System.Reactive.Concurrency
                 }
 
                 // indicate there is processing going on
-                isAcquired = true;
+                _isAcquired = true;
             }
 
             // if we get here, execute the "action" first
@@ -95,25 +95,25 @@ namespace System.Reactive.Concurrency
                 catch
                 {
                     // the execution failed, terminate this AsyncLock
-                    lock (guard)
+                    lock (_guard)
                     {
                         // throw away the queue
-                        queue = null;
+                        _queue = null;
                         // report fault
-                        hasFaulted = true;
+                        _hasFaulted = true;
                     }
                     throw;
                 }
 
                 // execution succeeded, let's see if more work has to be done
-                lock (guard)
+                lock (_guard)
                 {
-                    var q = queue;
+                    var q = _queue;
                     // either there is no queue yet or we run out of work
                     if (q == null || q.Count == 0)
                     {
                         // release the lock
-                        isAcquired = false;
+                        _isAcquired = false;
                         return;
                     }
 
@@ -129,10 +129,10 @@ namespace System.Reactive.Concurrency
         /// </summary>
         public void Dispose()
         {
-            lock (guard)
+            lock (_guard)
             {
-                queue = null;
-                hasFaulted = true;
+                _queue = null;
+                _hasFaulted = true;
             }
         }
     }

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 #if NO_THREAD && WINDOWS
-using System.Reactive.Disposables;
 using System.Threading;
 
 namespace System.Reactive.Concurrency

+ 3 - 4
Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 #if !NO_THREAD
-using System.Collections.Generic;
 using System.Reactive.Disposables;
 using System.Threading;
 
@@ -236,7 +235,7 @@ namespace System.Reactive.Concurrency
         private sealed class FastPeriodicTimer : IDisposable
         {
             private readonly Action _action;
-            private volatile bool disposed;
+            private volatile bool _disposed;
 
             public FastPeriodicTimer(Action action)
             {
@@ -254,7 +253,7 @@ namespace System.Reactive.Concurrency
             {
                 var timer = (FastPeriodicTimer)threadParam;
 
-                while (!timer.disposed)
+                while (!timer._disposed)
                 {
                     timer._action();
                 }
@@ -262,7 +261,7 @@ namespace System.Reactive.Concurrency
 
             public void Dispose()
             {
-                disposed = true;
+                _disposed = true;
             }
         }
     }

+ 16 - 16
Rx.NET/Source/src/System.Reactive/Concurrency/CurrentThreadScheduler.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Scheduler.CurrentThread">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class CurrentThreadScheduler : LocalScheduler
     {
-        private static readonly Lazy<CurrentThreadScheduler> s_instance = new Lazy<CurrentThreadScheduler>(() => new CurrentThreadScheduler());
+        private static readonly Lazy<CurrentThreadScheduler> _staticInstance = new Lazy<CurrentThreadScheduler>(() => new CurrentThreadScheduler());
 
         private CurrentThreadScheduler()
         {
@@ -21,34 +21,34 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Gets the singleton instance of the current thread scheduler.
         /// </summary>
-        public static CurrentThreadScheduler Instance => s_instance.Value;
+        public static CurrentThreadScheduler Instance => _staticInstance.Value;
 
         [ThreadStatic]
-        private static SchedulerQueue<TimeSpan> s_threadLocalQueue;
+        private static SchedulerQueue<TimeSpan> _threadLocalQueue;
 
         [ThreadStatic]
-        private static IStopwatch s_clock;
+        private static IStopwatch _clock;
 
         [ThreadStatic]
-        private static bool running;
+        private static bool _running;
 
-        private static SchedulerQueue<TimeSpan> GetQueue() => s_threadLocalQueue;
+        private static SchedulerQueue<TimeSpan> GetQueue() => _threadLocalQueue;
 
         private static void SetQueue(SchedulerQueue<TimeSpan> newQueue)
         {
-            s_threadLocalQueue = newQueue;
+            _threadLocalQueue = newQueue;
         }
 
         private static TimeSpan Time
         {
             get
             {
-                if (s_clock == null)
+                if (_clock == null)
                 {
-                    s_clock = ConcurrencyAbstractionLayer.Current.StartStopwatch();
+                    _clock = ConcurrencyAbstractionLayer.Current.StartStopwatch();
                 }
 
-                return s_clock.Elapsed;
+                return _clock.Elapsed;
             }
         }
 
@@ -64,7 +64,7 @@ namespace System.Reactive.Concurrency
         /// Gets a value that indicates whether the caller must call a Schedule method.
         /// </summary>
         [EditorBrowsable(EditorBrowsableState.Advanced)]
-        public static bool IsScheduleRequired => !running;
+        public static bool IsScheduleRequired => !_running;
 
         /// <summary>
         /// Schedules an action to be executed after dueTime.
@@ -85,9 +85,9 @@ namespace System.Reactive.Concurrency
             var queue = default(SchedulerQueue<TimeSpan>);
 
             // There is no timed task and no task is currently running
-            if (!running)
+            if (!_running)
             {
-                running = true;
+                _running = true;
 
                 if (dueTime > TimeSpan.Zero)
                 {
@@ -103,7 +103,7 @@ namespace System.Reactive.Concurrency
                 catch
                 {
                     SetQueue(null);
-                    running = false;
+                    _running = false;
                     throw;
                 }
 
@@ -120,12 +120,12 @@ namespace System.Reactive.Concurrency
                     finally
                     {
                         SetQueue(null);
-                        running = false;
+                        _running = false;
                     }
                 }
                 else
                 {
-                    running = false;
+                    _running = false;
                 }
 
                 return d;

+ 8 - 8
Rx.NET/Source/src/System.Reactive/Concurrency/DefaultScheduler.cs

@@ -12,13 +12,13 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Scheduler.Default">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class DefaultScheduler : LocalScheduler, ISchedulerPeriodic
     {
-        private static readonly Lazy<DefaultScheduler> s_instance = new Lazy<DefaultScheduler>(() => new DefaultScheduler());
-        private static IConcurrencyAbstractionLayer s_cal = ConcurrencyAbstractionLayer.Current;
+        private static readonly Lazy<DefaultScheduler> _instance = new Lazy<DefaultScheduler>(() => new DefaultScheduler());
+        private static IConcurrencyAbstractionLayer _cal = ConcurrencyAbstractionLayer.Current;
 
         /// <summary>
         /// Gets the singleton instance of the default scheduler.
         /// </summary>
-        public static DefaultScheduler Instance => s_instance.Value;
+        public static DefaultScheduler Instance => _instance.Value;
 
         private DefaultScheduler()
         {
@@ -41,7 +41,7 @@ namespace System.Reactive.Concurrency
 
             var workItem = new UserWorkItem<TState>(this, state, action);
 
-            workItem.CancelQueueDisposable = s_cal.QueueUserWorkItem(
+            workItem.CancelQueueDisposable = _cal.QueueUserWorkItem(
                 closureWorkItem => ((UserWorkItem<TState>)closureWorkItem).Run(),
                 workItem);
 
@@ -72,7 +72,7 @@ namespace System.Reactive.Concurrency
 
             var workItem = new UserWorkItem<TState>(this, state, action);
 
-            workItem.CancelQueueDisposable = s_cal.StartTimer(
+            workItem.CancelQueueDisposable = _cal.StartTimer(
                 closureWorkItem => ((UserWorkItem<TState>)closureWorkItem).Run(),
                 workItem,
                 dt);
@@ -117,7 +117,7 @@ namespace System.Reactive.Concurrency
                 _state = state;
                 _action = action;
 
-                _cancel = s_cal.StartPeriodicTimer(Tick, period);
+                _cancel = _cal.StartPeriodicTimer(Tick, period);
             }
 
             private void Tick()
@@ -145,7 +145,7 @@ namespace System.Reactive.Concurrency
         {
             if (serviceType == typeof(ISchedulerLongRunning))
             {
-                if (s_cal.SupportsLongRunning)
+                if (_cal.SupportsLongRunning)
                 {
                     return LongRunning.Instance;
                 }
@@ -168,7 +168,7 @@ namespace System.Reactive.Concurrency
                     _state = state;
                     _action = action;
 
-                    s_cal.StartThread(
+                    _cal.StartThread(
                         @thisObject =>
                         {
                             var @this = (LongScheduledWorkItem<TState>)@thisObject;

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs

@@ -18,7 +18,7 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Counter for diagnostic purposes, to name the threads.
         /// </summary>
-        private static int s_counter;
+        private static int _counter;
 
         /// <summary>
         /// Thread factory function.
@@ -82,7 +82,7 @@ namespace System.Reactive.Concurrency
         /// Creates an object that schedules units of work on a designated thread.
         /// </summary>
         public EventLoopScheduler()
-            : this(a => new Thread(a) { Name = "Event Loop " + Interlocked.Increment(ref s_counter), IsBackground = true })
+            : this(a => new Thread(a) { Name = "Event Loop " + Interlocked.Increment(ref _counter), IsBackground = true })
         {
         }
 

+ 6 - 6
Rx.NET/Source/src/System.Reactive/Concurrency/HistoricalScheduler.cs

@@ -69,7 +69,7 @@ namespace System.Reactive.Concurrency
     /// </summary>
     public class HistoricalScheduler : HistoricalSchedulerBase
     {
-        private readonly SchedulerQueue<DateTimeOffset> queue = new SchedulerQueue<DateTimeOffset>();
+        private readonly SchedulerQueue<DateTimeOffset> _queue = new SchedulerQueue<DateTimeOffset>();
 
         /// <summary>
         /// Creates a new historical scheduler with the minimum value of <see cref="DateTimeOffset"/> as the initial clock value.
@@ -105,13 +105,13 @@ namespace System.Reactive.Concurrency
         /// <returns>The next scheduled item.</returns>
         protected override IScheduledItem<DateTimeOffset> GetNext()
         {
-            while (queue.Count > 0)
+            while (_queue.Count > 0)
             {
-                var next = queue.Peek();
+                var next = _queue.Peek();
 
                 if (next.IsCanceled)
                 {
-                    queue.Dequeue();
+                    _queue.Dequeue();
                 }
                 else
                 {
@@ -142,12 +142,12 @@ namespace System.Reactive.Concurrency
 
             var run = new Func<IScheduler, TState, IDisposable>((scheduler, state1) =>
             {
-                queue.Remove(si);
+                _queue.Remove(si);
                 return action(scheduler, state1);
             });
 
             si = new ScheduledItem<DateTimeOffset, TState>(this, state, run, dueTime, Comparer);
-            queue.Enqueue(si);
+            _queue.Enqueue(si);
 
             return si;
         }

+ 9 - 9
Rx.NET/Source/src/System.Reactive/Concurrency/ImmediateScheduler.cs

@@ -12,7 +12,7 @@ namespace System.Reactive.Concurrency
     /// <seealso cref="Scheduler.Immediate">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class ImmediateScheduler : LocalScheduler
     {
-        private static readonly Lazy<ImmediateScheduler> s_instance = new Lazy<ImmediateScheduler>(() => new ImmediateScheduler());
+        private static readonly Lazy<ImmediateScheduler> _instance = new Lazy<ImmediateScheduler>(() => new ImmediateScheduler());
 
         private ImmediateScheduler()
         {
@@ -21,7 +21,7 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Gets the singleton instance of the immediate scheduler.
         /// </summary>
-        public static ImmediateScheduler Instance => s_instance.Value;
+        public static ImmediateScheduler Instance => _instance.Value;
 
         /// <summary>
         /// Schedules an action to be executed.
@@ -68,7 +68,7 @@ namespace System.Reactive.Concurrency
 
         private sealed class AsyncLockScheduler : LocalScheduler
         {
-            private AsyncLock asyncLock;
+            private AsyncLock _asyncLock;
 
             public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
             {
@@ -79,12 +79,12 @@ namespace System.Reactive.Concurrency
 
                 var m = new SingleAssignmentDisposable();
 
-                if (asyncLock == null)
+                if (_asyncLock == null)
                 {
-                    asyncLock = new AsyncLock();
+                    _asyncLock = new AsyncLock();
                 }
 
-                asyncLock.Wait(
+                _asyncLock.Wait(
                     (@this: this, m, action, state),
                     tuple =>
                     {
@@ -118,12 +118,12 @@ namespace System.Reactive.Concurrency
 
                 var m = new SingleAssignmentDisposable();
 
-                if (asyncLock == null)
+                if (_asyncLock == null)
                 {
-                    asyncLock = new AsyncLock();
+                    _asyncLock = new AsyncLock();
                 }
 
-                asyncLock.Wait(
+                _asyncLock.Wait(
                     (@this: this, m, state, action, timer, dueTime),
                     tuple =>
                     {

+ 20 - 20
Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs

@@ -20,20 +20,20 @@ namespace System.Reactive.Concurrency
         /// Gate to protect queues and to synchronize scheduling decisions and system clock
         /// change management.
         /// </summary>
-        private static readonly object s_gate = new object();
+        private static readonly object _staticGate = new object();
 
         /// <summary>
         /// Long term work queue. Contains work that's due beyond SHORTTERM, computed at the
         /// time of enqueueing.
         /// </summary>
-        private static readonly PriorityQueue<WorkItem/*!*/> s_longTerm = new PriorityQueue<WorkItem/*!*/>();
+        private static readonly PriorityQueue<WorkItem/*!*/> _longTerm = new PriorityQueue<WorkItem/*!*/>();
 
         /// <summary>
         /// Disposable resource for the long term timer that will reevaluate and dispatch the
         /// first item in the long term queue. A serial disposable is used to make "dispose
         /// current and assign new" logic easier. The disposable itself is never disposed.
         /// </summary>
-        private static readonly SerialDisposable s_nextLongTermTimer = new SerialDisposable();
+        private static readonly SerialDisposable _nextLongTermTimer = new SerialDisposable();
 
         /// <summary>
         /// Item at the head of the long term queue for which the current long term timer is
@@ -41,7 +41,7 @@ namespace System.Reactive.Concurrency
         /// or can continue using the current timer (because no earlier long term work was
         /// added to the queue).
         /// </summary>
-        private static WorkItem s_nextLongTermWorkItem;
+        private static WorkItem _nextLongTermWorkItem;
 
         /// <summary>
         /// Short term work queue. Contains work that's due soon, computed at the time of
@@ -137,7 +137,7 @@ namespace System.Reactive.Concurrency
             var due = Scheduler.Normalize(dueTime - Now);
             if (due == TimeSpan.Zero)
             {
-                return Schedule<TState>(state, TimeSpan.Zero, action);
+                return Schedule(state, TimeSpan.Zero, action);
             }
 
             //
@@ -277,9 +277,9 @@ namespace System.Reactive.Concurrency
         /// <param name="item">Work item to schedule on the long term. The caller is responsible to determine the work is indeed long term.</param>
         private static void ScheduleLongTermWork(WorkItem/*!*/ item)
         {
-            lock (s_gate)
+            lock (_staticGate)
             {
-                s_longTerm.Enqueue(item);
+                _longTerm.Enqueue(item);
 
                 //
                 // In case we're the first long-term item in the queue now, the timer will have
@@ -301,7 +301,7 @@ namespace System.Reactive.Concurrency
              * 
             lock (s_gate) */
             {
-                if (s_longTerm.Count == 0)
+                if (_longTerm.Count == 0)
                 {
                     return;
                 }
@@ -310,8 +310,8 @@ namespace System.Reactive.Concurrency
                 // To avoid setting the timer all over again for the first work item if it hasn't changed,
                 // we keep track of the next long term work item that will be processed by the timer.
                 //
-                var next = s_longTerm.Peek();
-                if (next == s_nextLongTermWorkItem)
+                var next = _longTerm.Peek();
+                if (next == _nextLongTermWorkItem)
                 {
                     return;
                 }
@@ -332,8 +332,8 @@ namespace System.Reactive.Concurrency
                 //
                 var dueCapped = TimeSpan.FromTicks(Math.Min(dueEarly.Ticks, MAXSUPPORTEDTIMER.Ticks));
 
-                s_nextLongTermWorkItem = next;
-                s_nextLongTermTimer.Disposable = ConcurrencyAbstractionLayer.Current.StartTimer(_ => EvaluateLongTermQueue(_), null, dueCapped);
+                _nextLongTermWorkItem = next;
+                _nextLongTermTimer.Disposable = ConcurrencyAbstractionLayer.Current.StartTimer(_ => EvaluateLongTermQueue(_), null, dueCapped);
             }
         }
 
@@ -344,13 +344,13 @@ namespace System.Reactive.Concurrency
         /// <param name="state">Ignored.</param>
         private static void EvaluateLongTermQueue(object state)
         {
-            lock (s_gate)
+            lock (_staticGate)
             {
                 var next = default(WorkItem);
 
-                while (s_longTerm.Count > 0)
+                while (_longTerm.Count > 0)
                 {
-                    next = s_longTerm.Peek();
+                    next = _longTerm.Peek();
 
                     var due = Scheduler.Normalize(next.DueTime - next.Scheduler.Now);
                     if (due >= SHORTTERM)
@@ -358,11 +358,11 @@ namespace System.Reactive.Concurrency
                         break;
                     }
 
-                    var item = s_longTerm.Dequeue();
+                    var item = _longTerm.Dequeue();
                     item.Scheduler.ScheduleShortTermWork(item);
                 }
 
-                s_nextLongTermWorkItem = null;
+                _nextLongTermWorkItem = null;
                 UpdateLongTermProcessingTimer();
             }
         }
@@ -375,7 +375,7 @@ namespace System.Reactive.Concurrency
         /// <param name="sender">Currently not used.</param>
         internal void SystemClockChanged(object sender, SystemClockChangedEventArgs args)
         {
-            lock (s_gate)
+            lock (_staticGate)
             {
                 lock (_gate)
                 {
@@ -400,14 +400,14 @@ namespace System.Reactive.Concurrency
                     while (_shortTerm.Count > 0)
                     {
                         var next = _shortTerm.Dequeue();
-                        s_longTerm.Enqueue(next);
+                        _longTerm.Enqueue(next);
                     }
 
                     //
                     // Reevaluate the queue and don't forget to null out the current timer to force the
                     // method to create a new timer for the new first long term item.
                     //
-                    s_nextLongTermWorkItem = null;
+                    _nextLongTermWorkItem = null;
                     EvaluateLongTermQueue(null);
                 }
             }

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Async.cs

@@ -140,7 +140,7 @@ namespace System.Reactive.Concurrency
                 throw new ArgumentNullException(nameof(action));
             }
 
-            return ScheduleAsync_<TState>(scheduler, state, action);
+            return ScheduleAsync_(scheduler, state, action);
         }
 
         /// <summary>
@@ -164,7 +164,7 @@ namespace System.Reactive.Concurrency
                 throw new ArgumentNullException(nameof(action));
             }
 
-            return ScheduleAsync_<TState>(scheduler, state, action);
+            return ScheduleAsync_(scheduler, state, action);
         }
 
         /// <summary>

+ 29 - 29
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Recursive.cs

@@ -173,41 +173,41 @@ namespace System.Reactive.Concurrency
 
         private abstract class InvokeRecBaseState<TState> : IDisposable
         {
-            protected readonly IScheduler scheduler;
+            protected readonly IScheduler Scheduler;
 
-            protected readonly CompositeDisposable group;
+            protected readonly CompositeDisposable Group;
 
             public InvokeRecBaseState(IScheduler scheduler)
             {
-                this.scheduler = scheduler;
-                group = new CompositeDisposable();
+                Scheduler = scheduler;
+                Group = new CompositeDisposable();
             }
 
             public void Dispose()
             {
-                group.Dispose();
+                Group.Dispose();
             }
 
         }
 
         private sealed class InvokeRec1State<TState> : InvokeRecBaseState<TState>
         {
-            private readonly Action<TState, Action<TState>> action;
-            private readonly Action<TState> recurseCallback;
+            private readonly Action<TState, Action<TState>> _action;
+            private readonly Action<TState> _recurseCallback;
 
             public InvokeRec1State(IScheduler scheduler, Action<TState, Action<TState>> action) : base(scheduler)
             {
-                this.action = action;
-                recurseCallback = state => InvokeNext(state);
+                _action = action;
+                _recurseCallback = state => InvokeNext(state);
             }
 
             internal void InvokeNext(TState state)
             {
                 var sad = new SingleAssignmentDisposable();
-                group.Add(sad);
-                sad.Disposable = scheduler.Schedule((state, sad, @this: this), (_, nextState) =>
+                Group.Add(sad);
+                sad.Disposable = Scheduler.Schedule((state, sad, @this: this), (_, nextState) =>
                 {
-                    nextState.@this.group.Remove(nextState.sad);
+                    nextState.@this.Group.Remove(nextState.sad);
                     [email protected](nextState.state);
                     return Disposable.Empty;
                 });
@@ -215,28 +215,28 @@ namespace System.Reactive.Concurrency
 
             internal void InvokeFirst(TState state)
             {
-                action(state, recurseCallback);
+                _action(state, _recurseCallback);
             }
         }
 
         private sealed class InvokeRec2State<TState> : InvokeRecBaseState<TState>
         {
-            private readonly Action<TState, Action<TState, TimeSpan>> action;
-            private readonly Action<TState, TimeSpan> recurseCallback;
+            private readonly Action<TState, Action<TState, TimeSpan>> _action;
+            private readonly Action<TState, TimeSpan> _recurseCallback;
 
             public InvokeRec2State(IScheduler scheduler, Action<TState, Action<TState, TimeSpan>> action) : base(scheduler)
             {
-                this.action = action;
-                recurseCallback = (state, time) => InvokeNext(state, time);
+                _action = action;
+                _recurseCallback = (state, time) => InvokeNext(state, time);
             }
 
             internal void InvokeNext(TState state, TimeSpan time)
             {
                 var sad = new SingleAssignmentDisposable();
-                group.Add(sad);
-                sad.Disposable = scheduler.Schedule((state, sad, @this: this), time, (_, nextState) =>
+                Group.Add(sad);
+                sad.Disposable = Scheduler.Schedule((state, sad, @this: this), time, (_, nextState) =>
                 {
-                    nextState.@this.group.Remove(nextState.sad);
+                    nextState.@this.Group.Remove(nextState.sad);
                     [email protected](nextState.state);
                     return Disposable.Empty;
                 });
@@ -244,28 +244,28 @@ namespace System.Reactive.Concurrency
 
             internal void InvokeFirst(TState state)
             {
-                action(state, recurseCallback);
+                _action(state, _recurseCallback);
             }
         }
 
         private sealed class InvokeRec3State<TState> : InvokeRecBaseState<TState>
         {
-            private readonly Action<TState, Action<TState, DateTimeOffset>> action;
-            private readonly Action<TState, DateTimeOffset> recurseCallback;
+            private readonly Action<TState, Action<TState, DateTimeOffset>> _action;
+            private readonly Action<TState, DateTimeOffset> _recurseCallback;
 
             public InvokeRec3State(IScheduler scheduler, Action<TState, Action<TState, DateTimeOffset>> action) : base(scheduler)
             {
-                this.action = action;
-                recurseCallback = (state, dtOffset) => InvokeNext(state, dtOffset);
+                _action = action;
+                _recurseCallback = (state, dtOffset) => InvokeNext(state, dtOffset);
             }
 
             internal void InvokeNext(TState state, DateTimeOffset dtOffset)
             {
                 var sad = new SingleAssignmentDisposable();
-                group.Add(sad);
-                sad.Disposable = scheduler.Schedule((state, sad, @this: this), dtOffset, (_, nextState) =>
+                Group.Add(sad);
+                sad.Disposable = Scheduler.Schedule((state, sad, @this: this), dtOffset, (_, nextState) =>
                 {
-                    nextState.@this.group.Remove(nextState.sad);
+                    nextState.@this.Group.Remove(nextState.sad);
                     [email protected](nextState.state);
                     return Disposable.Empty;
                 });
@@ -273,7 +273,7 @@ namespace System.Reactive.Concurrency
 
             internal void InvokeFirst(TState state)
             {
-                action(state, recurseCallback);
+                _action(state, _recurseCallback);
             }
         }
     }

+ 6 - 6
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs

@@ -60,29 +60,29 @@ namespace System.Reactive.Concurrency
         //
 
 
-        private static Lazy<IScheduler> s_threadPool = new Lazy<IScheduler>(() => Initialize("ThreadPool"));
+        private static Lazy<IScheduler> _threadPool = new Lazy<IScheduler>(() => Initialize("ThreadPool"));
 
         /// <summary>
         /// Gets a scheduler that schedules work on the thread pool.
         /// </summary>
         [Obsolete(Constants_Core.OBSOLETE_SCHEDULER_THREADPOOL)]
-        public static IScheduler ThreadPool => s_threadPool.Value;
+        public static IScheduler ThreadPool => _threadPool.Value;
 
-        private static Lazy<IScheduler> s_newThread = new Lazy<IScheduler>(() => Initialize("NewThread"));
+        private static Lazy<IScheduler> _newThread = new Lazy<IScheduler>(() => Initialize("NewThread"));
 
         /// <summary>
         /// Gets a scheduler that schedules work on a new thread using default thread creation options.
         /// </summary>
         [Obsolete(Constants_Core.OBSOLETE_SCHEDULER_NEWTHREAD)]
-        public static IScheduler NewThread => s_newThread.Value;
+        public static IScheduler NewThread => _newThread.Value;
 
-        private static Lazy<IScheduler> s_taskPool = new Lazy<IScheduler>(() => Initialize("TaskPool"));
+        private static Lazy<IScheduler> _taskPool = new Lazy<IScheduler>(() => Initialize("TaskPool"));
 
         /// <summary>
         /// Gets a scheduler that schedules work on Task Parallel Library (TPL) task pool using the default TaskScheduler.
         /// </summary>
         [Obsolete(Constants_Core.OBSOLETE_SCHEDULER_TASKPOOL)]
-        public static IScheduler TaskPool => s_taskPool.Value;
+        public static IScheduler TaskPool => _taskPool.Value;
 
         private static IScheduler Initialize(string name)
         {

+ 5 - 5
Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.cs

@@ -68,18 +68,18 @@ namespace System.Reactive.Concurrency
                 }
             }
 
-            private readonly IObservable<TSource> source;
-            private readonly IScheduler scheduler;
+            private readonly IObservable<TSource> _source;
+            private readonly IScheduler _scheduler;
 
             public SubscribeOnObservable(IObservable<TSource> source, IScheduler scheduler)
             {
-                this.source = source;
-                this.scheduler = scheduler;
+                _source = source;
+                _scheduler = scheduler;
             }
 
             protected override IDisposable SubscribeCore(IObserver<TSource> observer)
             {
-                return new Subscription(source, scheduler, observer);
+                return new Subscription(_source, _scheduler, observer);
             }
         }
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs

@@ -11,7 +11,7 @@ namespace System.Reactive.Concurrency
     /// <summary>
     /// Represents an object that schedules units of work on the Task Parallel Library (TPL) task pool.
     /// </summary>
-    /// <seealso cref="TaskPoolScheduler.Default">Instance of this type using the default TaskScheduler to schedule work on the TPL task pool.</seealso>
+    /// <seealso cref="Default">Instance of this type using the default TaskScheduler to schedule work on the TPL task pool.</seealso>
     public sealed class TaskPoolScheduler : LocalScheduler, ISchedulerLongRunning, ISchedulerPeriodic
     {
         private sealed class ScheduledWorkItem<TState> : IDisposable

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.Windows.cs

@@ -11,7 +11,7 @@ namespace System.Reactive.Concurrency
     /// <summary>
     /// Represents an object that schedules units of work on the Windows Runtime thread pool.
     /// </summary>
-    /// <seealso cref="ThreadPoolScheduler.Default">Singleton instance of this type exposed through this static property.</seealso>
+    /// <seealso cref="Default">Singleton instance of this type exposed through this static property.</seealso>
     [CLSCompliant(false)]
     public sealed class ThreadPoolScheduler : LocalScheduler, ISchedulerPeriodic
     {

+ 1 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 #if !WINDOWS && !NO_THREAD
-using System.Collections.Generic;
 using System.Reactive.Disposables;
 using System.Threading;
 
@@ -12,7 +11,7 @@ namespace System.Reactive.Concurrency
     /// <summary>
     /// Represents an object that schedules units of work on the CLR thread pool.
     /// </summary>
-    /// <seealso cref="ThreadPoolScheduler.Instance">Singleton instance of this type exposed through this static property.</seealso>
+    /// <seealso cref="Instance">Singleton instance of this type exposed through this static property.</seealso>
     public sealed class ThreadPoolScheduler : LocalScheduler, ISchedulerLongRunning, ISchedulerPeriodic
     {
         private static readonly Lazy<ThreadPoolScheduler> LazyInstance = new Lazy<ThreadPoolScheduler>(() => new ThreadPoolScheduler());

+ 9 - 9
Rx.NET/Source/src/System.Reactive/Concurrency/VirtualTimeScheduler.cs

@@ -357,7 +357,7 @@ namespace System.Reactive.Concurrency
     public abstract class VirtualTimeScheduler<TAbsolute, TRelative> : VirtualTimeSchedulerBase<TAbsolute, TRelative>
         where TAbsolute : IComparable<TAbsolute>
     {
-        private readonly SchedulerQueue<TAbsolute> queue = new SchedulerQueue<TAbsolute>();
+        private readonly SchedulerQueue<TAbsolute> _queue = new SchedulerQueue<TAbsolute>();
 
         /// <summary>
         /// Creates a new virtual time scheduler with the default value of TAbsolute as the initial clock value.
@@ -384,14 +384,14 @@ namespace System.Reactive.Concurrency
         /// <returns>The next scheduled item.</returns>
         protected override IScheduledItem<TAbsolute> GetNext()
         {
-            lock (queue)
+            lock (_queue)
             {
-                while (queue.Count > 0)
+                while (_queue.Count > 0)
                 {
-                    var next = queue.Peek();
+                    var next = _queue.Peek();
                     if (next.IsCanceled)
                     {
-                        queue.Dequeue();
+                        _queue.Dequeue();
                     }
                     else
                     {
@@ -423,9 +423,9 @@ namespace System.Reactive.Concurrency
 
             var run = new Func<IScheduler, TState, IDisposable>((scheduler, state1) =>
             {
-                lock (queue)
+                lock (_queue)
                 {
-                    queue.Remove(si);
+                    _queue.Remove(si);
                 }
 
                 return action(scheduler, state1);
@@ -433,9 +433,9 @@ namespace System.Reactive.Concurrency
 
             si = new ScheduledItem<TAbsolute, TState>(this, state, run, dueTime, Comparer);
 
-            lock (queue)
+            lock (_queue)
             {
-                queue.Enqueue(si);
+                _queue.Enqueue(si);
             }
 
             return si;

+ 10 - 10
Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs

@@ -388,18 +388,18 @@ namespace System.Reactive.Disposables
         /// </summary>
         private sealed class CompositeEnumerator : IEnumerator<IDisposable>
         {
-            private readonly IDisposable[] disposables;
-            private int index;
+            private readonly IDisposable[] _disposables;
+            private int _index;
 
             public CompositeEnumerator(IDisposable[] disposables)
             {
-                this.disposables = disposables;
-                index = -1;
+                _disposables = disposables;
+                _index = -1;
             }
 
-            public IDisposable Current => disposables[index];
+            public IDisposable Current => _disposables[_index];
 
-            object IEnumerator.Current => disposables[index];
+            object IEnumerator.Current => _disposables[_index];
 
             public void Dispose()
             {
@@ -407,17 +407,17 @@ namespace System.Reactive.Disposables
                 // beyond the lifecycle of the enumerator.
                 // Not sure if this happens by default to
                 // generic array enumerators though.
-                var disposables = this.disposables;
+                var disposables = _disposables;
                 Array.Clear(disposables, 0, disposables.Length);
             }
 
             public bool MoveNext()
             {
-                var disposables = this.disposables;
+                var disposables = _disposables;
 
                 for (; ; )
                 {
-                    var idx = ++index;
+                    var idx = ++_index;
                     if (idx >= disposables.Length)
                     {
                         return false;
@@ -432,7 +432,7 @@ namespace System.Reactive.Disposables
 
             public void Reset()
             {
-                index = -1;
+                _index = -1;
             }
         }
     }

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Internal/ExceptionServices.cs

@@ -9,15 +9,15 @@ namespace System.Reactive
 {
     internal static class ExceptionHelpers
     {
-        private static Lazy<IExceptionServices> s_services = new Lazy<IExceptionServices>(Initialize);
+        private static Lazy<IExceptionServices> _services = new Lazy<IExceptionServices>(Initialize);
 
-        public static void Throw(this Exception exception) => s_services.Value.Rethrow(exception);
+        public static void Throw(this Exception exception) => _services.Value.Rethrow(exception);
 
         public static void ThrowIfNotNull(this Exception exception)
         {
             if (exception != null)
             {
-                s_services.Value.Rethrow(exception);
+                _services.Value.Rethrow(exception);
             }
         }
 

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Internal/HostLifecycleService.cs

@@ -13,7 +13,7 @@ namespace System.Reactive.PlatformServices
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class HostLifecycleService
     {
-        private static Lazy<IHostLifecycleNotifications> s_notifications = new Lazy<IHostLifecycleNotifications>(InitializeNotifications);
+        private static Lazy<IHostLifecycleNotifications> _notifications = new Lazy<IHostLifecycleNotifications>(InitializeNotifications);
 
         private static int _refCount;
 
@@ -34,7 +34,7 @@ namespace System.Reactive.PlatformServices
         {
             if (Interlocked.Increment(ref _refCount) == 1)
             {
-                var notifications = s_notifications.Value;
+                var notifications = _notifications.Value;
                 if (notifications != null)
                 {
                     notifications.Suspending += OnSuspending;
@@ -51,7 +51,7 @@ namespace System.Reactive.PlatformServices
         {
             if (Interlocked.Decrement(ref _refCount) == 0)
             {
-                var notifications = s_notifications.Value;
+                var notifications = _notifications.Value;
                 if (notifications != null)
                 {
                     notifications.Suspending -= OnSuspending;

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Internal/ImmutableList.cs

@@ -58,7 +58,7 @@ namespace System.Reactive
         {
             for (var i = 0; i < _data.Length; ++i)
             {
-                if (object.Equals(_data[i], value))
+                if (Equals(_data[i], value))
                 {
                     return i;
                 }

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProvider.cs

@@ -34,7 +34,7 @@ namespace System.Reactive.PlatformServices
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class PlatformEnlightenmentProvider
     {
-        private static IPlatformEnlightenmentProvider s_current = CreatePlatformProvider();
+        private static IPlatformEnlightenmentProvider _current = CreatePlatformProvider();
 
         /// <summary>
         /// (Infrastructure) Gets the current enlightenment provider. If none is loaded yet, accessing this property triggers provider resolution.
@@ -47,12 +47,12 @@ namespace System.Reactive.PlatformServices
         {
             get
             {
-                return s_current;
+                return _current;
             }
 
             set
             {
-                s_current = value ?? throw new ArgumentNullException(nameof(value));
+                _current = value ?? throw new ArgumentNullException(nameof(value));
             }
 
         }

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Internal/QueryServices.cs

@@ -8,9 +8,9 @@ namespace System.Reactive.Linq
 {
     internal static class QueryServices
     {
-        private static readonly IQueryServices s_services = Initialize();
+        private static readonly IQueryServices _services = Initialize();
 
-        public static T GetQueryImpl<T>(T defaultInstance) => s_services.Extend(defaultInstance);
+        public static T GetQueryImpl<T>(T defaultInstance) => _services.Extend(defaultInstance);
 
         private static IQueryServices Initialize()
         {

+ 3 - 1
Rx.NET/Source/src/System.Reactive/Internal/ReflectionUtils.cs

@@ -2,11 +2,13 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-using System.Collections.Generic;
 using System.Globalization;
 using System.Reflection;
 
 #if HAS_WINRT
+#if CRIPPLED_REFLECTION
+using System.Collections.Generic;
+#endif
 using System.Runtime.InteropServices.WindowsRuntime;
 #endif
 

+ 39 - 39
Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs

@@ -383,50 +383,50 @@ namespace System.Reactive
     /// <typeparam name="T">The element type of the sequence.</typeparam>
     internal sealed class ObserveOnObserverNew<T> : IObserver<T>, IDisposable
     {
-        private readonly IObserver<T> downstream;
-        private readonly IScheduler scheduler;
+        private readonly IObserver<T> _downstream;
+        private readonly IScheduler _scheduler;
 
         /// <summary>
-        /// If not null, the <see cref="scheduler"/> supports
+        /// If not null, the <see cref="_scheduler"/> supports
         /// long running tasks.
         /// </summary>
-        private readonly ISchedulerLongRunning longRunning;
-        private readonly ConcurrentQueue<T> queue;
+        private readonly ISchedulerLongRunning _longRunning;
+        private readonly ConcurrentQueue<T> _queue;
         private IDisposable _run;
 
         /// <summary>
         /// The current task representing a running drain operation.
         /// </summary>
-        private IDisposable task;
+        private IDisposable _task;
 
         /// <summary>
         /// Indicates the work-in-progress state of this operator,
         /// zero means no work is currently being done.
         /// </summary>
-        private int wip;
+        private int _wip;
 
         /// <summary>
         /// If true, the upstream has issued OnCompleted.
         /// </summary>
-        private bool done;
+        private bool _done;
 
         /// <summary>
-        /// If <see cref="done"/> is true and this is non-null, the upstream
+        /// If <see cref="_done"/> is true and this is non-null, the upstream
         /// failed with an OnError.
         /// </summary>
-        private Exception error;
+        private Exception _error;
 
         /// <summary>
         /// Indicates a dispose has been requested.
         /// </summary>
-        private bool disposed;
+        private bool _disposed;
 
         public ObserveOnObserverNew(IScheduler scheduler, IObserver<T> downstream)
         {
-            this.downstream = downstream;
-            this.scheduler = scheduler;
-            longRunning = scheduler.AsLongRunning();
-            queue = new ConcurrentQueue<T>();
+            _downstream = downstream;
+            _scheduler = scheduler;
+            _longRunning = scheduler.AsLongRunning();
+            _queue = new ConcurrentQueue<T>();
         }
 
         public void Run(IObservable<T> source)
@@ -436,8 +436,8 @@ namespace System.Reactive
 
         public void Dispose()
         {
-            Volatile.Write(ref disposed, true);
-            Disposable.TryDispose(ref task);
+            Volatile.Write(ref _disposed, true);
+            Disposable.TryDispose(ref _task);
             Disposable.TryDispose(ref _run);
             Clear();
         }
@@ -448,7 +448,7 @@ namespace System.Reactive
         /// </summary>
         private void Clear()
         {
-            var q = queue;
+            var q = _queue;
             while (q.TryDequeue(out var _))
             {
                 ;
@@ -457,20 +457,20 @@ namespace System.Reactive
 
         public void OnCompleted()
         {
-            Volatile.Write(ref done, true);
+            Volatile.Write(ref _done, true);
             Schedule();
         }
 
         public void OnError(Exception error)
         {
-            this.error = error;
-            Volatile.Write(ref done, true);
+            _error = error;
+            Volatile.Write(ref _done, true);
             Schedule();
         }
 
         public void OnNext(T value)
         {
-            queue.Enqueue(value);
+            _queue.Enqueue(value);
             Schedule();
         }
 
@@ -480,20 +480,20 @@ namespace System.Reactive
         /// </summary>
         private void Schedule()
         {
-            if (Interlocked.Increment(ref wip) == 1)
+            if (Interlocked.Increment(ref _wip) == 1)
             {
                 var newTask = new SingleAssignmentDisposable();
 
-                if (Disposable.TrySetMultiple(ref task, newTask))
+                if (Disposable.TrySetMultiple(ref _task, newTask))
                 {
-                    var longRunning = this.longRunning;
+                    var longRunning = _longRunning;
                     if (longRunning != null)
                     {
                         newTask.Disposable = longRunning.ScheduleLongRunning(this, DRAIN_LONG_RUNNING);
                     }
                     else
                     {
-                        newTask.Disposable = scheduler.Schedule(this, DRAIN_SHORT_RUNNING);
+                        newTask.Disposable = _scheduler.Schedule(this, DRAIN_SHORT_RUNNING);
                     }
                 }
 
@@ -501,7 +501,7 @@ namespace System.Reactive
                 // of items. This doesn't have to be inside the
                 // wip != 0 (exclusive) mode as the queue
                 // is of a multi-consumer type.
-                if (Volatile.Read(ref disposed))
+                if (Volatile.Read(ref _disposed))
                 {
                     Clear();
                 }
@@ -532,9 +532,9 @@ namespace System.Reactive
         /// <returns>The IDisposable of the recursively scheduled task or an empty disposable.</returns>
         private IDisposable DrainShortRunning(IScheduler recursiveScheduler)
         {
-            DrainStep(queue, downstream, false);
+            DrainStep(_queue, _downstream, false);
 
-            if (Interlocked.Decrement(ref wip) != 0)
+            if (Interlocked.Decrement(ref _wip) != 0)
             {
                 return recursiveScheduler.Schedule(this, DRAIN_SHORT_RUNNING);
             }
@@ -555,7 +555,7 @@ namespace System.Reactive
         private bool DrainStep(ConcurrentQueue<T> q, IObserver<T> downstream, bool delayError)
         {
             // Check if the operator has been disposed
-            if (Volatile.Read(ref disposed))
+            if (Volatile.Read(ref _disposed))
             {
                 // cleanup residue items in the queue
                 Clear();
@@ -563,33 +563,33 @@ namespace System.Reactive
             }
 
             // Has the upstream call OnCompleted?
-            var d = Volatile.Read(ref done);
+            var d = Volatile.Read(ref _done);
 
             if (d && !delayError)
             {
                 // done = true happens before setting error
                 // this is safe to be a plain read
-                var ex = error;
+                var ex = _error;
                 // if not null, there was an OnError call
                 if (ex != null)
                 {
-                    Volatile.Write(ref disposed, true);
+                    Volatile.Write(ref _disposed, true);
                     downstream.OnError(ex);
                     return true;
                 }
             }
 
             // get the next item from the queue if any
-            var empty = !queue.TryDequeue(out var v);
+            var empty = !_queue.TryDequeue(out var v);
 
             // the upstream called OnComplete and the queue is empty
             // that means we are done, no further signals can happen
             if (d && empty)
             {
-                Volatile.Write(ref disposed, true);
+                Volatile.Write(ref _disposed, true);
                 // done = true happens before setting error
                 // this is safe to be a plain read
-                var ex = error;
+                var ex = _error;
                 // if not null, there was an OnError call
                 if (ex != null)
                 {
@@ -627,8 +627,8 @@ namespace System.Reactive
             // read out fields upfront as the DrainStep uses atomics
             // that would force the re-read of these constant values
             // from memory, regardless of readonly, afaik
-            var q = queue;
-            var downstream = this.downstream;
+            var q = _queue;
+            var downstream = _downstream;
 
             for (; ; )
             {
@@ -643,7 +643,7 @@ namespace System.Reactive
                     }
                 }
 
-                missed = Interlocked.Add(ref wip, -missed);
+                missed = Interlocked.Add(ref _wip, -missed);
                 if (missed == 0)
                 {
                     break;

+ 20 - 20
Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs

@@ -19,17 +19,17 @@ namespace System.Reactive.PlatformServices
     [EditorBrowsable(EditorBrowsableState.Never)]
     public static class SystemClock
     {
-        private static Lazy<ISystemClock> s_serviceSystemClock = new Lazy<ISystemClock>(InitializeSystemClock);
-        private static Lazy<INotifySystemClockChanged> s_serviceSystemClockChanged = new Lazy<INotifySystemClockChanged>(InitializeSystemClockChanged);
-        private static readonly HashSet<WeakReference<LocalScheduler>> s_systemClockChanged = new HashSet<WeakReference<LocalScheduler>>();
-        private static IDisposable s_systemClockChangedHandlerCollector;
+        private static Lazy<ISystemClock> _serviceSystemClock = new Lazy<ISystemClock>(InitializeSystemClock);
+        private static Lazy<INotifySystemClockChanged> _serviceSystemClockChanged = new Lazy<INotifySystemClockChanged>(InitializeSystemClockChanged);
+        private static readonly HashSet<WeakReference<LocalScheduler>> _systemClockChanged = new HashSet<WeakReference<LocalScheduler>>();
+        private static IDisposable _systemClockChangedHandlerCollector;
 
         private static int _refCount;
 
         /// <summary>
         /// Gets the local system clock time.
         /// </summary>
-        public static DateTimeOffset UtcNow => s_serviceSystemClock.Value.UtcNow;
+        public static DateTimeOffset UtcNow => _serviceSystemClock.Value.UtcNow;
 
         /// <summary>
         /// Adds a reference to the system clock monitor, causing it to be sending notifications.
@@ -39,7 +39,7 @@ namespace System.Reactive.PlatformServices
         {
             if (Interlocked.Increment(ref _refCount) == 1)
             {
-                s_serviceSystemClockChanged.Value.SystemClockChanged += OnSystemClockChanged;
+                _serviceSystemClockChanged.Value.SystemClockChanged += OnSystemClockChanged;
             }
         }
 
@@ -51,15 +51,15 @@ namespace System.Reactive.PlatformServices
         {
             if (Interlocked.Decrement(ref _refCount) == 0)
             {
-                s_serviceSystemClockChanged.Value.SystemClockChanged -= OnSystemClockChanged;
+                _serviceSystemClockChanged.Value.SystemClockChanged -= OnSystemClockChanged;
             }
         }
 
         private static void OnSystemClockChanged(object sender, SystemClockChangedEventArgs e)
         {
-            lock (s_systemClockChanged)
+            lock (_systemClockChanged)
             {
-                foreach (var entry in s_systemClockChanged)
+                foreach (var entry in _systemClockChanged)
                 {
                     if (entry.TryGetTarget(out var scheduler))
                     {
@@ -93,15 +93,15 @@ namespace System.Reactive.PlatformServices
             // can have a lot of instances, so we need to collect spurious handlers
             // at regular times.
             //
-            lock (s_systemClockChanged)
+            lock (_systemClockChanged)
             {
-                s_systemClockChanged.Add(new WeakReference<LocalScheduler>(scheduler));
+                _systemClockChanged.Add(new WeakReference<LocalScheduler>(scheduler));
 
-                if (s_systemClockChanged.Count == 1)
+                if (_systemClockChanged.Count == 1)
                 {
-                    s_systemClockChangedHandlerCollector = ConcurrencyAbstractionLayer.Current.StartPeriodicTimer(CollectHandlers, TimeSpan.FromSeconds(30));
+                    _systemClockChangedHandlerCollector = ConcurrencyAbstractionLayer.Current.StartPeriodicTimer(CollectHandlers, TimeSpan.FromSeconds(30));
                 }
-                else if (s_systemClockChanged.Count % 64 == 0)
+                else if (_systemClockChanged.Count % 64 == 0)
                 {
                     CollectHandlers();
                 }
@@ -117,11 +117,11 @@ namespace System.Reactive.PlatformServices
             // the ConditionalWeakTable<TKey, TValue> type here because we need to
             // be able to enumerate the keys.
             //
-            lock (s_systemClockChanged)
+            lock (_systemClockChanged)
             {
                 var remove = default(HashSet<WeakReference<LocalScheduler>>);
 
-                foreach (var handler in s_systemClockChanged)
+                foreach (var handler in _systemClockChanged)
                 {
                     if (!handler.TryGetTarget(out var scheduler))
                     {
@@ -138,14 +138,14 @@ namespace System.Reactive.PlatformServices
                 {
                     foreach (var handler in remove)
                     {
-                        s_systemClockChanged.Remove(handler);
+                        _systemClockChanged.Remove(handler);
                     }
                 }
 
-                if (s_systemClockChanged.Count == 0)
+                if (_systemClockChanged.Count == 0)
                 {
-                    s_systemClockChangedHandlerCollector.Dispose();
-                    s_systemClockChangedHandlerCollector = null;
+                    _systemClockChangedHandlerCollector.Dispose();
+                    _systemClockChangedHandlerCollector = null;
                 }
             }
         }

File diff suppressed because it is too large
+ 330 - 347
Rx.NET/Source/src/System.Reactive/Joins/ActivePlan.cs


+ 52 - 52
Rx.NET/Source/src/System.Reactive/Linq/Observable.Aggregates.cs

@@ -213,13 +213,13 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Decimal" /> values.
+        /// Computes the average of an observable sequence of <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Decimal" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of <see cref="decimal" /> values to calculate the average of.</param>
         /// <returns>An observable sequence containing a single element with the average of the sequence of values.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal> Average(this IObservable<decimal> source)
         {
@@ -238,7 +238,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double> Average(this IObservable<int> source)
         {
@@ -257,7 +257,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double> Average(this IObservable<long> source)
         {
@@ -306,13 +306,13 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Decimal" /> values.
+        /// Computes the average of an observable sequence of nullable <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Decimal" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of nullable <see cref="decimal" /> values to calculate the average of.</param>
         /// <returns>An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal?> Average(this IObservable<decimal?> source)
         {
@@ -332,7 +332,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         public static IObservable<double?> Average(this IObservable<int?> source)
         {
             if (source == null)
@@ -350,7 +350,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double?> Average(this IObservable<long?> source)
         {
@@ -363,7 +363,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the average of an observable sequence of <see cref="decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to calculate the average of.</param>
@@ -371,7 +371,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal> Average<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
         {
@@ -447,7 +447,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double> Average<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
         {
@@ -473,7 +473,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double> Average<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
         {
@@ -491,7 +491,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the average of an observable sequence of nullable <see cref="decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to calculate the average of.</param>
@@ -499,7 +499,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal?> Average<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
         {
@@ -575,7 +575,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double?> Average<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
         {
@@ -601,7 +601,7 @@ namespace System.Reactive.Linq
         /// <returns>An observable sequence containing a single element with the average of the sequence of values, or null if the source sequence is empty or contains only values that are null.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <exception cref="InvalidOperationException">(Asynchronous) The source sequence is empty.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<double?> Average<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
         {
@@ -677,7 +677,7 @@ namespace System.Reactive.Linq
         /// <param name="source">An observable sequence that contains elements to be counted.</param>
         /// <returns>An observable sequence containing a single element with the number of elements in the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The number of elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The number of elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<int> Count<TSource>(this IObservable<TSource> source)
         {
@@ -982,7 +982,7 @@ namespace System.Reactive.Linq
         /// <param name="source">An observable sequence that contains elements to be counted.</param>
         /// <returns>An observable sequence containing a single element with the number of elements in the input sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The number of elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The number of elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<long> LongCount<TSource>(this IObservable<TSource> source)
         {
@@ -1099,9 +1099,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of <see cref="Decimal" /> values.
+        /// Returns the maximum value in an observable sequence of <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Decimal" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of <see cref="decimal" /> values to determine the maximum value of.</param>
         /// <returns>An observable sequence containing a single element with the maximum value in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -1184,9 +1184,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of nullable <see cref="Decimal" /> values.
+        /// Returns the maximum value in an observable sequence of nullable <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Decimal" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="decimal" /> values to determine the maximum value of.</param>
         /// <returns>An observable sequence containing a single element with the maximum value in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -1339,12 +1339,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="Decimal" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="decimal" /> value.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="Decimal" /> that corresponds to the maximum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="decimal" /> that corresponds to the maximum value in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal> Max<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
@@ -1459,7 +1459,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="Decimal" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="decimal" /> value.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the maximum value of.</param>
@@ -1671,9 +1671,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of <see cref="Decimal" /> values.
+        /// Returns the minimum value in an observable sequence of <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Decimal" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of <see cref="decimal" /> values to determine the minimum value of.</param>
         /// <returns>An observable sequence containing a single element with the minimum value in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -1756,9 +1756,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of nullable <see cref="Decimal" /> values.
+        /// Returns the minimum value in an observable sequence of nullable <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Decimal" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="decimal" /> values to determine the minimum value of.</param>
         /// <returns>An observable sequence containing a single element with the minimum value in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -1911,12 +1911,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="Decimal" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="decimal" /> value.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the minimum value of.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
-        /// <returns>An observable sequence containing a single element with the value of type <see cref="Decimal" /> that corresponds to the minimum value in the source sequence.</returns>
+        /// <returns>An observable sequence containing a single element with the value of type <see cref="decimal" /> that corresponds to the minimum value in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal> Min<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
@@ -2031,7 +2031,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="Decimal" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="decimal" /> value.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values to determine the minimum value of.</param>
@@ -2405,12 +2405,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Decimal" /> values.
+        /// Computes the sum of a sequence of <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Decimal" /> values to calculate the sum of.</param>
+        /// <param name="source">A sequence of <see cref="decimal" /> values to calculate the sum of.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal> Sum(this IObservable<decimal> source)
         {
@@ -2428,7 +2428,7 @@ namespace System.Reactive.Linq
         /// <param name="source">A sequence of <see cref="int" /> values to calculate the sum of.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int32.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="int.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<int> Sum(this IObservable<int> source)
         {
@@ -2446,7 +2446,7 @@ namespace System.Reactive.Linq
         /// <param name="source">A sequence of <see cref="long" /> values to calculate the sum of.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<long> Sum(this IObservable<long> source)
         {
@@ -2493,12 +2493,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Decimal" /> values.
+        /// Computes the sum of a sequence of nullable <see cref="decimal" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Decimal" /> values to calculate the sum of.</param>
+        /// <param name="source">A sequence of nullable <see cref="decimal" /> values to calculate the sum of.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal?> Sum(this IObservable<decimal?> source)
         {
@@ -2516,7 +2516,7 @@ namespace System.Reactive.Linq
         /// <param name="source">A sequence of nullable <see cref="int" /> values to calculate the sum of.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int32.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="int.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<int?> Sum(this IObservable<int?> source)
         {
@@ -2534,7 +2534,7 @@ namespace System.Reactive.Linq
         /// <param name="source">A sequence of nullable <see cref="long" /> values to calculate the sum of.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<long?> Sum(this IObservable<long?> source)
         {
@@ -2595,14 +2595,14 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of <see cref="decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal> Sum<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
         {
@@ -2627,7 +2627,7 @@ namespace System.Reactive.Linq
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int32.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="int.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<int> Sum<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
         {
@@ -2652,7 +2652,7 @@ namespace System.Reactive.Linq
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<long> Sum<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
         {
@@ -2718,14 +2718,14 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
+        /// Computes the sum of a sequence of nullable <see cref="decimal" /> values that are obtained by invoking a transform function on each element of the input sequence.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">A sequence of values that are used to calculate a sum.</param>
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Decimal.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="decimal.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<decimal?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
         {
@@ -2750,7 +2750,7 @@ namespace System.Reactive.Linq
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int32.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="int.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<int?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
         {
@@ -2775,7 +2775,7 @@ namespace System.Reactive.Linq
         /// <param name="selector">A transform function to apply to each element.</param>
         /// <returns>An observable sequence containing a single element with the sum of the values in the source sequence.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="selector"/> is null.</exception>
-        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="Int64.MaxValue"/>.</exception>
+        /// <exception cref="OverflowException">(Asynchronous) The sum of the projected values for the elements in the source sequence is larger than <see cref="long.MaxValue"/>.</exception>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
         public static IObservable<long?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
         {

+ 4 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable.Awaiter.cs

@@ -24,7 +24,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return s_impl.GetAwaiter<TSource>(source);
+            return s_impl.GetAwaiter(source);
         }
 
         /// <summary>
@@ -42,7 +42,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return s_impl.GetAwaiter<TSource>(source);
+            return s_impl.GetAwaiter(source);
         }
 
         /// <summary>
@@ -61,7 +61,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return s_impl.RunAsync<TSource>(source, cancellationToken);
+            return s_impl.RunAsync(source, cancellationToken);
         }
 
         /// <summary>
@@ -80,7 +80,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return s_impl.RunAsync<TSource>(source, cancellationToken);
+            return s_impl.RunAsync(source, cancellationToken);
         }
     }
 }

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs

@@ -404,7 +404,7 @@ namespace System.Reactive.Linq
         /// <param name="start">The value of the first integer in the sequence.</param>
         /// <param name="count">The number of sequential integers to generate.</param>
         /// <returns>An observable sequence that contains a range of sequential integral numbers.</returns>
-        /// <exception cref="ArgumentOutOfRangeException"><paramref name="count"/> is less than zero. -or- <paramref name="start"/> + <paramref name="count"/> - 1 is larger than <see cref="Int32.MaxValue"/>.</exception>
+        /// <exception cref="ArgumentOutOfRangeException"><paramref name="count"/> is less than zero. -or- <paramref name="start"/> + <paramref name="count"/> - 1 is larger than <see cref="int.MaxValue"/>.</exception>
         public static IObservable<int> Range(int start, int count)
         {
             var max = ((long)start) + count - 1;
@@ -423,7 +423,7 @@ namespace System.Reactive.Linq
         /// <param name="count">The number of sequential integers to generate.</param>
         /// <param name="scheduler">Scheduler to run the generator loop on.</param>
         /// <returns>An observable sequence that contains a range of sequential integral numbers.</returns>
-        /// <exception cref="ArgumentOutOfRangeException"><paramref name="count"/> is less than zero. -or- <paramref name="start"/> + <paramref name="count"/> - 1 is larger than <see cref="Int32.MaxValue"/>.</exception>
+        /// <exception cref="ArgumentOutOfRangeException"><paramref name="count"/> is less than zero. -or- <paramref name="start"/> + <paramref name="count"/> - 1 is larger than <see cref="int.MaxValue"/>.</exception>
         /// <exception cref="ArgumentNullException"><paramref name="scheduler"/> is null.</exception>
         public static IObservable<int> Range(int start, int count, IScheduler scheduler)
         {

+ 3 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable.Queryable.cs

@@ -8,7 +8,9 @@ namespace System.Reactive.Linq
 {
     public static partial class Qbservable
     {
+#pragma warning disable IDE1006 // Naming Styles: 3rd party code is known to reflect for this specific field name
         private static IQbservableProvider s_provider;
+#pragma warning restore IDE1006 // Naming Styles
 
         /// <summary>
         /// Gets the local query provider which will retarget Qbservable-based queries to the corresponding Observable-based query for in-memory execution upon subscription.
@@ -45,4 +47,4 @@ namespace System.Reactive.Linq
     }
 }
 
-#pragma warning restore 1591
+#pragma warning restore 1591

+ 43 - 53
Rx.NET/Source/src/System.Reactive/Linq/Observable/Amb.cs

@@ -2,7 +2,6 @@
 // The .NET Foundation licenses this file to you under the Apache 2.0 License.
 // See the LICENSE file in the project root for more information. 
 
-using System.Reactive.Disposables;
 using System.Threading;
 
 namespace System.Reactive.Linq.ObservableImpl
@@ -24,26 +23,26 @@ namespace System.Reactive.Linq.ObservableImpl
 
         internal sealed class AmbCoordinator : IDisposable
         {
-            private readonly AmbObserver leftObserver;
-            private readonly AmbObserver rightObserver;
-            private int winner;
+            private readonly AmbObserver _leftObserver;
+            private readonly AmbObserver _rightObserver;
+            private int _winner;
 
             public AmbCoordinator(IObserver<TSource> observer)
             {
-                leftObserver = new AmbObserver(observer, this, true);
-                rightObserver = new AmbObserver(observer, this, false);
+                _leftObserver = new AmbObserver(observer, this, true);
+                _rightObserver = new AmbObserver(observer, this, false);
             }
 
             public void Run(IObservable<TSource> left, IObservable<TSource> right)
             {
-                leftObserver.OnSubscribe(left.Subscribe(leftObserver));
-                rightObserver.OnSubscribe(right.Subscribe(rightObserver));
+                _leftObserver.Run(left);
+                _rightObserver.Run(right);
             }
 
             public void Dispose()
             {
-                leftObserver.Dispose();
-                rightObserver.Dispose();
+                _leftObserver.Dispose();
+                _rightObserver.Dispose();
             }
 
             /// <summary>
@@ -55,89 +54,80 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 var index = isLeft ? 1 : 2;
 
-                if (Volatile.Read(ref winner) == index)
+                if (Volatile.Read(ref _winner) == index)
                 {
                     return true;
                 }
-                if (Interlocked.CompareExchange(ref winner, index, 0) == 0)
+                if (Interlocked.CompareExchange(ref _winner, index, 0) == 0)
                 {
-                    (isLeft ? rightObserver : leftObserver).Dispose();
+                    (isLeft ? _rightObserver : _leftObserver).Dispose();
                     return true;
                 }
                 return false;
             }
 
-            private sealed class AmbObserver : IObserver<TSource>, IDisposable
+            private sealed class AmbObserver : IdentitySink<TSource>
             {
-                private readonly IObserver<TSource> downstream;
-                private readonly AmbCoordinator parent;
-                private readonly bool isLeft;
-                private IDisposable upstream;
+                private readonly AmbCoordinator _parent;
+                private readonly bool _isLeft;
 
                 /// <summary>
                 /// If true, this observer won the race and now can emit
                 /// on a fast path.
                 /// </summary>
-                private bool iwon;
+                private bool _iwon;
 
-                public AmbObserver(IObserver<TSource> downstream, AmbCoordinator parent, bool isLeft)
+                public AmbObserver(IObserver<TSource> downstream, AmbCoordinator parent, bool isLeft) : base(downstream)
                 {
-                    this.downstream = downstream;
-                    this.parent = parent;
-                    this.isLeft = isLeft;
+                    _parent = parent;
+                    _isLeft = isLeft;
                 }
 
-                internal void OnSubscribe(IDisposable d)
+                public override void OnCompleted()
                 {
-                    Disposable.SetSingle(ref upstream, d);
-                }
-
-                public void Dispose()
-                {
-                    Disposable.TryDispose(ref upstream);
-                }
-
-                public void OnCompleted()
-                {
-                    if (iwon)
+                    if (_iwon)
+                    {
+                        ForwardOnCompleted();
+                    }
+                    else if (_parent.TryWin(_isLeft))
                     {
-                        downstream.OnCompleted();
+                        _iwon = true;
+                        ForwardOnCompleted();
                     }
                     else
-                    if (parent.TryWin(isLeft))
                     {
-                        iwon = true;
-                        downstream.OnCompleted();
+                        Dispose();
                     }
-                    Dispose();
                 }
 
-                public void OnError(Exception error)
+                public override void OnError(Exception error)
                 {
-                    if (iwon)
+                    if (_iwon)
+                    {
+                        ForwardOnError(error);
+                    }
+                    else if (_parent.TryWin(_isLeft))
                     {
-                        downstream.OnError(error);
+                        _iwon = true;
+                        ForwardOnError(error);
                     }
                     else
-                    if (parent.TryWin(isLeft))
                     {
-                        iwon = true;
-                        downstream.OnError(error);
+                        Dispose();
                     }
-                    Dispose();
                 }
 
-                public void OnNext(TSource value)
+                public override void OnNext(TSource value)
                 {
-                    if (iwon)
+                    if (_iwon)
                     {
-                        downstream.OnNext(value);
+                        ForwardOnNext(value);
                     }
                     else
-                    if (parent.TryWin(isLeft))
+                    if (_parent.TryWin(_isLeft))
                     {
-                        iwon = true;
-                        downstream.OnNext(value);
+                        _iwon = true;
+                        ForwardOnNext(value);
                     }
                 }
             }

+ 51 - 62
Rx.NET/Source/src/System.Reactive/Linq/Observable/AmbMany.cs

@@ -11,31 +11,31 @@ namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class AmbManyArray<T> : BasicProducer<T>
     {
-        private readonly IObservable<T>[] sources;
+        private readonly IObservable<T>[] _sources;
 
         public AmbManyArray(IObservable<T>[] sources)
         {
-            this.sources = sources;
+            _sources = sources;
         }
 
         protected override IDisposable Run(IObserver<T> observer)
         {
-            return AmbCoordinator<T>.Create(observer, sources);
+            return AmbCoordinator<T>.Create(observer, _sources);
         }
     }
 
     internal sealed class AmbManyEnumerable<T> : BasicProducer<T>
     {
-        private readonly IEnumerable<IObservable<T>> sources;
+        private readonly IEnumerable<IObservable<T>> _sources;
 
         public AmbManyEnumerable(IEnumerable<IObservable<T>> sources)
         {
-            this.sources = sources;
+            _sources = sources;
         }
 
         protected override IDisposable Run(IObserver<T> observer)
         {
-            var sourcesEnumerable = this.sources;
+            var sourcesEnumerable = _sources;
             var sources = default(IObservable<T>[]);
 
             try
@@ -54,20 +54,20 @@ namespace System.Reactive.Linq.ObservableImpl
 
     internal sealed class AmbCoordinator<T> : IDisposable
     {
-        private readonly IObserver<T> downstream;
-        private readonly InnerObserver[] observers;
-        private int winner;
+        private readonly IObserver<T> _downstream;
+        private readonly InnerObserver[] _observers;
+        private int _winner;
 
         internal AmbCoordinator(IObserver<T> downstream, int n)
         {
-            this.downstream = downstream;
+            _downstream = downstream;
             var o = new InnerObserver[n];
             for (var i = 0; i < n; i++)
             {
                 o[i] = new InnerObserver(this, i);
             }
-            observers = o;
-            Volatile.Write(ref winner, -1);
+            _observers = o;
+            Volatile.Write(ref _winner, -1);
         }
 
         internal static IDisposable Create(IObserver<T> observer, IObservable<T>[] sources)
@@ -93,34 +93,34 @@ namespace System.Reactive.Linq.ObservableImpl
 
         internal void Subscribe(IObservable<T>[] sources)
         {
-            for (var i = 0; i < observers.Length; i++)
+            for (var i = 0; i < _observers.Length; i++)
             {
-                var inner = Volatile.Read(ref observers[i]);
+                var inner = Volatile.Read(ref _observers[i]);
                 if (inner == null)
                 {
                     break;
                 }
-                inner.OnSubscribe(sources[i].Subscribe(inner));
+                inner.Run(sources[i]);
             }
         }
 
         public void Dispose()
         {
-            for (var i = 0; i < observers.Length; i++)
+            for (var i = 0; i < _observers.Length; i++)
             {
-                Interlocked.Exchange(ref observers[i], null)?.Dispose();
+                Interlocked.Exchange(ref _observers[i], null)?.Dispose();
             }
         }
 
         private bool TryWin(int index)
         {
-            if (Volatile.Read(ref winner) == -1 && Interlocked.CompareExchange(ref winner, index, -1) == -1)
+            if (Volatile.Read(ref _winner) == -1 && Interlocked.CompareExchange(ref _winner, index, -1) == -1)
             {
-                for (var i = 0; i < observers.Length; i++)
+                for (var i = 0; i < _observers.Length; i++)
                 {
                     if (index != i)
                     {
-                        Interlocked.Exchange(ref observers[i], null)?.Dispose();
+                        Interlocked.Exchange(ref _observers[i], null)?.Dispose();
                     }
                 }
                 return true;
@@ -128,79 +128,68 @@ namespace System.Reactive.Linq.ObservableImpl
             return false;
         }
 
-        internal sealed class InnerObserver : IObserver<T>, IDisposable
+        internal sealed class InnerObserver : IdentitySink<T>
         {
-            private readonly IObserver<T> downstream;
-            private readonly AmbCoordinator<T> parent;
-            private readonly int index;
-            private IDisposable upstream;
-            private bool won;
-
-            public InnerObserver(AmbCoordinator<T> parent, int index)
-            {
-                downstream = parent.downstream;
-                this.parent = parent;
-                this.index = index;
-            }
+            private readonly AmbCoordinator<T> _parent;
+            private readonly int _index;
+            private bool _won;
 
-            public void Dispose()
+            public InnerObserver(AmbCoordinator<T> parent, int index) : base(parent._downstream)
             {
-                Disposable.TryDispose(ref upstream);
+                _parent = parent;
+                _index = index;
             }
 
-            public void OnCompleted()
+            public override void OnCompleted()
             {
-                if (won)
+                if (_won)
                 {
-                    downstream.OnCompleted();
+                    ForwardOnCompleted();
+                }
+                else if (_parent.TryWin(_index))
+                {
+                    _won = true;
+                    ForwardOnCompleted();
                 }
                 else
-                if (parent.TryWin(index))
                 {
-                    won = true;
-                    downstream.OnCompleted();
+                    Dispose();
                 }
-                Dispose();
             }
 
-            public void OnError(Exception error)
+            public override void OnError(Exception error)
             {
-                if (won)
+                if (_won)
                 {
-                    downstream.OnError(error);
+                    ForwardOnError(error);
+                }
+                else if (_parent.TryWin(_index))
+                {
+                    _won = true;
+                    ForwardOnError(error);
                 }
                 else
-                if (parent.TryWin(index))
                 {
-                    won = true;
-                    downstream.OnError(error);
+                    Dispose();
                 }
-                Dispose();
             }
 
-            public void OnNext(T value)
+            public override void OnNext(T value)
             {
-                if (won)
+                if (_won)
                 {
-                    downstream.OnNext(value);
+                    ForwardOnNext(value);
                 }
-                else
-                if (parent.TryWin(index))
+                else if (_parent.TryWin(_index))
                 {
-                    won = true;
-                    downstream.OnNext(value);
+                    _won = true;
+                    ForwardOnNext(value);
                 }
                 else
                 {
                     Dispose();
                 }
             }
-
-            internal void OnSubscribe(IDisposable d)
-            {
-                Disposable.SetSingle(ref upstream, d);
-            }
         }
-
     }
 }

+ 12 - 12
Rx.NET/Source/src/System.Reactive/Linq/Observable/AutoConnect.cs

@@ -14,28 +14,28 @@ namespace System.Reactive.Linq.ObservableImpl
     /// <typeparam name="T">The upstream value type.</typeparam>
     internal sealed class AutoConnect<T> : IObservable<T>
     {
-        private readonly IConnectableObservable<T> source;
-        private readonly int minObservers;
-        private readonly Action<IDisposable> onConnect;
-        private int count;
+        private readonly IConnectableObservable<T> _source;
+        private readonly int _minObservers;
+        private readonly Action<IDisposable> _onConnect;
+        private int _count;
 
         internal AutoConnect(IConnectableObservable<T> source, int minObservers, Action<IDisposable> onConnect)
         {
-            this.source = source;
-            this.minObservers = minObservers;
-            this.onConnect = onConnect;
+            _source = source;
+            _minObservers = minObservers;
+            _onConnect = onConnect;
         }
 
         public IDisposable Subscribe(IObserver<T> observer)
         {
-            var d = source.Subscribe(observer);
+            var d = _source.Subscribe(observer);
 
-            if (Volatile.Read(ref count) < minObservers)
+            if (Volatile.Read(ref _count) < _minObservers)
             {
-                if (Interlocked.Increment(ref count) == minObservers)
+                if (Interlocked.Increment(ref _count) == _minObservers)
                 {
-                    var c = source.Connect();
-                    onConnect?.Invoke(c);
+                    var c = _source.Connect();
+                    _onConnect?.Invoke(c);
                 }
             }
             return d;

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Linq/Observable/Buffer.cs

@@ -292,7 +292,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     CreateWindow();
                     CreateTimer();
 
-                    base.Run(parent._source);
+                    Run(parent._source);
                 }
 
                 protected override void Dispose(bool disposing)
@@ -449,7 +449,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     _list = new List<TSource>();
 
                     Disposable.SetSingle(ref _periodicDisposable, parent._scheduler.SchedulePeriodic(this, parent._timeSpan, @this => @this.Tick()));
-                    base.Run(parent._source);
+                    Run(parent._source);
                 }
 
                 protected override void Dispose(bool disposing)
@@ -805,7 +805,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 {
                     _buffer = new List<TSource>();
 
-                    base.Run(parent._source);
+                    Run(parent._source);
                     Disposable.SetSingle(ref _boundariesDisposable, parent._bufferBoundaries.SubscribeSafe(new BufferClosingObserver(this)));
                 }
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Case.cs

@@ -54,7 +54,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     return;
                 }
 
-                base.Run(result);
+                Run(result);
             }
         }
     }

+ 51 - 51
Rx.NET/Source/src/System.Reactive/Linq/Observable/ConcatMany.cs

@@ -10,11 +10,11 @@ namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class ConcatMany<T> : IObservable<T>
     {
-        private readonly IObservable<IObservable<T>> sources;
+        private readonly IObservable<IObservable<T>> _sources;
 
         internal ConcatMany(IObservable<IObservable<T>> sources)
         {
-            this.sources = sources;
+            _sources = sources;
         }
 
         public IDisposable Subscribe(IObserver<T> observer)
@@ -24,84 +24,84 @@ namespace System.Reactive.Linq.ObservableImpl
                 throw new ArgumentNullException(nameof(observer));
             }
             var parent = new ConcatManyOuterObserver(observer);
-            var d = sources.SubscribeSafe(parent);
+            var d = _sources.SubscribeSafe(parent);
             parent.OnSubscribe(d);
             return parent;
         }
 
         internal sealed class ConcatManyOuterObserver : IObserver<IObservable<T>>, IDisposable
         {
-            private readonly IObserver<T> downstream;
-            private readonly ConcurrentQueue<IObservable<T>> queue;
-            private readonly InnerObserver innerObserver;
-            private IDisposable upstream;
-            private int trampoline;
-            private Exception error;
-            private bool done;
-            private int active;
+            private readonly IObserver<T> _downstream;
+            private readonly ConcurrentQueue<IObservable<T>> _queue;
+            private readonly InnerObserver _innerObserver;
+            private IDisposable _upstream;
+            private int _trampoline;
+            private Exception _error;
+            private bool _done;
+            private int _active;
 
             internal ConcatManyOuterObserver(IObserver<T> downstream)
             {
-                this.downstream = downstream;
-                queue = new ConcurrentQueue<IObservable<T>>();
-                innerObserver = new InnerObserver(this);
+                _downstream = downstream;
+                _queue = new ConcurrentQueue<IObservable<T>>();
+                _innerObserver = new InnerObserver(this);
             }
 
             internal void OnSubscribe(IDisposable d)
             {
-                Disposable.SetSingle(ref upstream, d);
+                Disposable.SetSingle(ref _upstream, d);
             }
 
             public void Dispose()
             {
-                innerObserver.Dispose();
+                _innerObserver.Dispose();
                 DisposeMain();
             }
 
             private void DisposeMain()
             {
-                Disposable.TryDispose(ref upstream);
+                Disposable.TryDispose(ref _upstream);
             }
 
             private bool IsDisposed()
             {
-                return Disposable.GetIsDisposed(ref upstream);
+                return Disposable.GetIsDisposed(ref _upstream);
             }
 
             public void OnCompleted()
             {
-                Volatile.Write(ref done, true);
+                Volatile.Write(ref _done, true);
                 Drain();
             }
 
             public void OnError(Exception error)
             {
-                if (Interlocked.CompareExchange(ref this.error, error, null) == null)
+                if (Interlocked.CompareExchange(ref _error, error, null) == null)
                 {
-                    Volatile.Write(ref done, true);
+                    Volatile.Write(ref _done, true);
                     Drain();
                 }
             }
 
             public void OnNext(IObservable<T> value)
             {
-                queue.Enqueue(value);
+                _queue.Enqueue(value);
                 Drain();
             }
 
             private void InnerNext(T item)
             {
-                downstream.OnNext(item);
+                _downstream.OnNext(item);
             }
 
             private void InnerError(Exception error)
             {
-                if (innerObserver.Finish())
+                if (_innerObserver.Finish())
                 {
-                    if (Interlocked.CompareExchange(ref this.error, error, null) == null)
+                    if (Interlocked.CompareExchange(ref _error, error, null) == null)
                     {
-                        Volatile.Write(ref done, true);
-                        Volatile.Write(ref active, 0);
+                        Volatile.Write(ref _done, true);
+                        Volatile.Write(ref _active, 0);
                         Drain();
                     }
                 }
@@ -109,16 +109,16 @@ namespace System.Reactive.Linq.ObservableImpl
 
             private void InnerComplete()
             {
-                if (innerObserver.Finish())
+                if (_innerObserver.Finish())
                 {
-                    Volatile.Write(ref active, 0);
+                    Volatile.Write(ref _active, 0);
                     Drain();
                 }
             }
 
             private void Drain()
             {
-                if (Interlocked.Increment(ref trampoline) != 1)
+                if (Interlocked.Increment(ref _trampoline) != 1)
                 {
                     return;
                 }
@@ -127,72 +127,72 @@ namespace System.Reactive.Linq.ObservableImpl
                 {
                     if (IsDisposed())
                     {
-                        while (queue.TryDequeue(out var _))
+                        while (_queue.TryDequeue(out var _))
                         {
                             ;
                         }
                     }
                     else
                     {
-                        if (Volatile.Read(ref active) == 0)
+                        if (Volatile.Read(ref _active) == 0)
                         {
-                            var isDone = Volatile.Read(ref done);
+                            var isDone = Volatile.Read(ref _done);
 
                             if (isDone)
                             {
-                                var ex = Volatile.Read(ref error);
+                                var ex = Volatile.Read(ref _error);
                                 if (ex != null)
                                 {
-                                    downstream.OnError(ex);
+                                    _downstream.OnError(ex);
                                     DisposeMain();
                                     continue;
                                 }
                             }
 
-                            if (queue.TryDequeue(out var source))
+                            if (_queue.TryDequeue(out var source))
                             {
                                 var sad = new SingleAssignmentDisposable();
-                                if (innerObserver.SetDisposable(sad))
+                                if (_innerObserver.SetDisposable(sad))
                                 {
-                                    Interlocked.Exchange(ref active, 1);
-                                    sad.Disposable = source.SubscribeSafe(innerObserver);
+                                    Interlocked.Exchange(ref _active, 1);
+                                    sad.Disposable = source.SubscribeSafe(_innerObserver);
                                 }
                             }
                             else
                             {
                                 if (isDone)
                                 {
-                                    downstream.OnCompleted();
+                                    _downstream.OnCompleted();
                                     DisposeMain();
                                 }
                             }
                         }
                     }
-                } while (Interlocked.Decrement(ref trampoline) != 0);
+                } while (Interlocked.Decrement(ref _trampoline) != 0);
             }
 
             internal sealed class InnerObserver : IObserver<T>, IDisposable
             {
-                private readonly ConcatManyOuterObserver parent;
+                private readonly ConcatManyOuterObserver _parent;
 
-                internal IDisposable upstream;
+                internal IDisposable Upstream;
 
                 internal InnerObserver(ConcatManyOuterObserver parent)
                 {
-                    this.parent = parent;
+                    _parent = parent;
                 }
 
                 internal bool SetDisposable(SingleAssignmentDisposable sad)
                 {
-                    return Disposable.TrySetSingle(ref upstream, sad) == TrySetSingleResult.Success;
+                    return Disposable.TrySetSingle(ref Upstream, sad) == TrySetSingleResult.Success;
                 }
 
                 internal bool Finish()
                 {
-                    var sad = Volatile.Read(ref upstream);
+                    var sad = Volatile.Read(ref Upstream);
                     if (sad != BooleanDisposable.True)
                     {
-                        if (Interlocked.CompareExchange(ref upstream, null, sad) == sad)
+                        if (Interlocked.CompareExchange(ref Upstream, null, sad) == sad)
                         {
                             sad.Dispose();
                             return true;
@@ -203,22 +203,22 @@ namespace System.Reactive.Linq.ObservableImpl
 
                 public void Dispose()
                 {
-                    Disposable.TryDispose(ref upstream);
+                    Disposable.TryDispose(ref Upstream);
                 }
 
                 public void OnCompleted()
                 {
-                    parent.InnerComplete();
+                    _parent.InnerComplete();
                 }
 
                 public void OnError(Exception error)
                 {
-                    parent.InnerError(error);
+                    _parent.InnerError(error);
                 }
 
                 public void OnNext(T value)
                 {
-                    parent.InnerNext(value);
+                    _parent.InnerNext(value);
                 }
             }
         }

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Defer.cs

@@ -44,7 +44,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     return;
                 }
 
-                base.Run(result);
+                Run(result);
             }
         }
     }

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/FirstLastBlocking.cs

@@ -14,7 +14,7 @@ namespace System.Reactive.Linq.ObservableImpl
         internal T _value;
         internal bool _hasValue;
         internal Exception _error;
-        private int once;
+        private int _once;
 
         internal BaseBlocking() : base(1) { }
 
@@ -25,7 +25,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         protected void Unblock()
         {
-            if (Interlocked.CompareExchange(ref once, 1, 0) == 0)
+            if (Interlocked.CompareExchange(ref _once, 1, 0) == 0)
             {
                 Signal();
             }

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Multicast.cs

@@ -49,7 +49,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     return;
                 }
 
-                base.Run(observable);
+                Run(observable);
                 Disposable.SetSingle(ref _connection, connectable.Connect());
             }
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/RefCount.cs

@@ -40,7 +40,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
                 public void Run()
                 {
-                    base.Run(_parent._source);
+                    Run(_parent._source);
 
                     lock (_parent._gate)
                     {

+ 4 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable/Repeat.cs

@@ -28,7 +28,7 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 private readonly TResult _value;
 
-                IDisposable _task;
+                private IDisposable _task;
 
                 public _(TResult value, IObserver<TResult> observer)
                     : base(observer)
@@ -127,9 +127,9 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 private readonly TResult _value;
 
-                int _remaining;
+                private int _remaining;
 
-                IDisposable _task;
+                private IDisposable _task;
 
                 public _(TResult value, int repeatCount, IObserver<TResult> observer)
                     : base(observer)
@@ -197,7 +197,7 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 private readonly TResult _value;
 
-                int _remaining;
+                private readonly int _remaining;
 
                 public _(TResult value, int remaining, IObserver<TResult> observer)
                     : base(observer)

+ 36 - 36
Rx.NET/Source/src/System.Reactive/Linq/Observable/RepeatWhen.cs

@@ -10,13 +10,13 @@ namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class RepeatWhen<T, U> : IObservable<T>
     {
-        private readonly IObservable<T> source;
-        private readonly Func<IObservable<object>, IObservable<U>> handler;
+        private readonly IObservable<T> _source;
+        private readonly Func<IObservable<object>, IObservable<U>> _handler;
 
         internal RepeatWhen(IObservable<T> source, Func<IObservable<object>, IObservable<U>> handler)
         {
-            this.source = source;
-            this.handler = handler;
+            _source = source;
+            _handler = handler;
         }
 
         public IDisposable Subscribe(IObserver<T> observer)
@@ -31,7 +31,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
             try
             {
-                redo = handler(completeSignals);
+                redo = _handler(completeSignals);
                 if (redo == null)
                 {
                     throw new NullReferenceException("The handler returned a null IObservable");
@@ -43,10 +43,10 @@ namespace System.Reactive.Linq.ObservableImpl
                 return Disposable.Empty;
             }
 
-            var parent = new MainObserver(observer, source, new RedoSerializedObserver<object>(completeSignals));
+            var parent = new MainObserver(observer, _source, new RedoSerializedObserver<object>(completeSignals));
 
-            var d = redo.SubscribeSafe(parent.handlerObserver);
-            Disposable.SetSingle(ref parent.handlerUpstream, d);
+            var d = redo.SubscribeSafe(parent.HandlerConsumer);
+            Disposable.SetSingle(ref parent.HandlerUpstream, d);
 
             parent.HandlerNext();
 
@@ -55,103 +55,103 @@ namespace System.Reactive.Linq.ObservableImpl
 
         private sealed class MainObserver : Sink<T>, IObserver<T>
         {
-            private readonly IObserver<Exception> errorSignal;
+            private readonly IObserver<Exception> _errorSignal;
 
-            internal readonly HandlerObserver handlerObserver;
-            private readonly IObservable<T> source;
-            private IDisposable upstream;
+            internal readonly HandlerObserver HandlerConsumer;
+            private readonly IObservable<T> _source;
+            private IDisposable _upstream;
 
-            internal IDisposable handlerUpstream;
-            private int trampoline;
-            private int halfSerializer;
-            private Exception error;
+            internal IDisposable HandlerUpstream;
+            private int _trampoline;
+            private int _halfSerializer;
+            private Exception _error;
 
             internal MainObserver(IObserver<T> downstream, IObservable<T> source, IObserver<Exception> errorSignal) : base(downstream)
             {
-                this.source = source;
-                this.errorSignal = errorSignal;
-                handlerObserver = new HandlerObserver(this);
+                _source = source;
+                _errorSignal = errorSignal;
+                HandlerConsumer = new HandlerObserver(this);
             }
 
             protected override void Dispose(bool disposing)
             {
                 if (disposing)
                 {
-                    Disposable.TryDispose(ref upstream);
-                    Disposable.TryDispose(ref handlerUpstream);
+                    Disposable.TryDispose(ref _upstream);
+                    Disposable.TryDispose(ref HandlerUpstream);
                 }
                 base.Dispose(disposing);
             }
 
             public void OnCompleted()
             {
-                if (Disposable.TrySetSerial(ref upstream, null))
+                if (Disposable.TrySetSerial(ref _upstream, null))
                 {
-                    errorSignal.OnNext(null);
+                    _errorSignal.OnNext(null);
                 }
 
             }
 
             public void OnError(Exception error)
             {
-                HalfSerializer.ForwardOnError(this, error, ref halfSerializer, ref this.error);
+                HalfSerializer.ForwardOnError(this, error, ref _halfSerializer, ref _error);
             }
 
             public void OnNext(T value)
             {
-                HalfSerializer.ForwardOnNext(this, value, ref halfSerializer, ref error);
+                HalfSerializer.ForwardOnNext(this, value, ref _halfSerializer, ref _error);
             }
 
             internal void HandlerError(Exception error)
             {
-                HalfSerializer.ForwardOnError(this, error, ref halfSerializer, ref this.error);
+                HalfSerializer.ForwardOnError(this, error, ref _halfSerializer, ref _error);
             }
 
             internal void HandlerComplete()
             {
-                HalfSerializer.ForwardOnCompleted(this, ref halfSerializer, ref error);
+                HalfSerializer.ForwardOnCompleted(this, ref _halfSerializer, ref _error);
             }
 
             internal void HandlerNext()
             {
-                if (Interlocked.Increment(ref trampoline) == 1)
+                if (Interlocked.Increment(ref _trampoline) == 1)
                 {
                     do
                     {
                         var sad = new SingleAssignmentDisposable();
-                        if (Interlocked.CompareExchange(ref upstream, sad, null) != null)
+                        if (Interlocked.CompareExchange(ref _upstream, sad, null) != null)
                         {
                             return;
                         }
 
-                        sad.Disposable = source.SubscribeSafe(this);
+                        sad.Disposable = _source.SubscribeSafe(this);
                     }
-                    while (Interlocked.Decrement(ref trampoline) != 0);
+                    while (Interlocked.Decrement(ref _trampoline) != 0);
                 }
             }
 
             internal sealed class HandlerObserver : IObserver<U>
             {
-                private readonly MainObserver main;
+                private readonly MainObserver _main;
 
                 internal HandlerObserver(MainObserver main)
                 {
-                    this.main = main;
+                    _main = main;
                 }
 
                 public void OnCompleted()
                 {
-                    main.HandlerComplete();
+                    _main.HandlerComplete();
                 }
 
                 public void OnError(Exception error)
                 {
-                    main.HandlerError(error);
+                    _main.HandlerError(error);
                 }
 
                 public void OnNext(U value)
                 {
-                    main.HandlerNext();
+                    _main.HandlerNext();
                 }
             }
         }

+ 58 - 58
Rx.NET/Source/src/System.Reactive/Linq/Observable/RetryWhen.cs

@@ -11,13 +11,13 @@ namespace System.Reactive.Linq.ObservableImpl
 {
     internal sealed class RetryWhen<T, U> : IObservable<T>
     {
-        private readonly IObservable<T> source;
-        private readonly Func<IObservable<Exception>, IObservable<U>> handler;
+        private readonly IObservable<T> _source;
+        private readonly Func<IObservable<Exception>, IObservable<U>> _handler;
 
         internal RetryWhen(IObservable<T> source, Func<IObservable<Exception>, IObservable<U>> handler)
         {
-            this.source = source;
-            this.handler = handler;
+            _source = source;
+            _handler = handler;
         }
 
         public IDisposable Subscribe(IObserver<T> observer)
@@ -32,7 +32,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
             try
             {
-                redo = handler(errorSignals);
+                redo = _handler(errorSignals);
                 if (redo == null)
                 {
                     throw new NullReferenceException("The handler returned a null IObservable");
@@ -44,10 +44,10 @@ namespace System.Reactive.Linq.ObservableImpl
                 return Disposable.Empty;
             }
 
-            var parent = new MainObserver(observer, source, new RedoSerializedObserver<Exception>(errorSignals));
+            var parent = new MainObserver(observer, _source, new RedoSerializedObserver<Exception>(errorSignals));
 
-            var d = redo.SubscribeSafe(parent.handlerObserver);
-            Disposable.SetSingle(ref parent.handlerUpstream, d);
+            var d = redo.SubscribeSafe(parent.HandlerConsumer);
+            Disposable.SetSingle(ref parent.HandlerUpstream, d);
 
             parent.HandlerNext();
 
@@ -56,101 +56,101 @@ namespace System.Reactive.Linq.ObservableImpl
 
         private sealed class MainObserver : Sink<T>, IObserver<T>
         {
-            private readonly IObserver<Exception> errorSignal;
+            private readonly IObserver<Exception> _errorSignal;
 
-            internal readonly HandlerObserver handlerObserver;
-            private readonly IObservable<T> source;
-            private IDisposable upstream;
-            internal IDisposable handlerUpstream;
-            private int trampoline;
-            private int halfSerializer;
-            private Exception error;
+            internal readonly HandlerObserver HandlerConsumer;
+            private readonly IObservable<T> _source;
+            private IDisposable _upstream;
+            internal IDisposable HandlerUpstream;
+            private int _trampoline;
+            private int _halfSerializer;
+            private Exception _error;
 
             internal MainObserver(IObserver<T> downstream, IObservable<T> source, IObserver<Exception> errorSignal) : base(downstream)
             {
-                this.source = source;
-                this.errorSignal = errorSignal;
-                handlerObserver = new HandlerObserver(this);
+                _source = source;
+                _errorSignal = errorSignal;
+                HandlerConsumer = new HandlerObserver(this);
             }
 
             protected override void Dispose(bool disposing)
             {
                 if (disposing)
                 {
-                    Disposable.TryDispose(ref upstream);
-                    Disposable.TryDispose(ref handlerUpstream);
+                    Disposable.TryDispose(ref _upstream);
+                    Disposable.TryDispose(ref HandlerUpstream);
                 }
                 base.Dispose(disposing);
             }
 
             public void OnCompleted()
             {
-                HalfSerializer.ForwardOnCompleted(this, ref halfSerializer, ref error);
+                HalfSerializer.ForwardOnCompleted(this, ref _halfSerializer, ref _error);
             }
 
             public void OnError(Exception error)
             {
-                if (Disposable.TrySetSerial(ref upstream, null))
+                if (Disposable.TrySetSerial(ref _upstream, null))
                 {
-                    errorSignal.OnNext(error);
+                    _errorSignal.OnNext(error);
                 }
             }
 
             public void OnNext(T value)
             {
-                HalfSerializer.ForwardOnNext(this, value, ref halfSerializer, ref error);
+                HalfSerializer.ForwardOnNext(this, value, ref _halfSerializer, ref _error);
             }
 
             internal void HandlerError(Exception error)
             {
-                HalfSerializer.ForwardOnError(this, error, ref halfSerializer, ref this.error);
+                HalfSerializer.ForwardOnError(this, error, ref _halfSerializer, ref _error);
             }
 
             internal void HandlerComplete()
             {
-                HalfSerializer.ForwardOnCompleted(this, ref halfSerializer, ref error);
+                HalfSerializer.ForwardOnCompleted(this, ref _halfSerializer, ref _error);
             }
 
             internal void HandlerNext()
             {
-                if (Interlocked.Increment(ref trampoline) == 1)
+                if (Interlocked.Increment(ref _trampoline) == 1)
                 {
                     do
                     {
                         var sad = new SingleAssignmentDisposable();
-                        if (Disposable.TrySetSingle(ref upstream, sad) != TrySetSingleResult.Success)
+                        if (Disposable.TrySetSingle(ref _upstream, sad) != TrySetSingleResult.Success)
                         {
                             return;
                         }
 
-                        sad.Disposable = source.SubscribeSafe(this);
+                        sad.Disposable = _source.SubscribeSafe(this);
                     }
-                    while (Interlocked.Decrement(ref trampoline) != 0);
+                    while (Interlocked.Decrement(ref _trampoline) != 0);
                 }
             }
 
             internal sealed class HandlerObserver : IObserver<U>
             {
-                private readonly MainObserver main;
+                private readonly MainObserver _main;
 
                 internal HandlerObserver(MainObserver main)
                 {
-                    this.main = main;
+                    _main = main;
                 }
 
                 public void OnCompleted()
                 {
-                    main.HandlerComplete();
+                    _main.HandlerComplete();
                 }
 
                 public void OnError(Exception error)
                 {
-                    main.HandlerError(error);
+                    _main.HandlerError(error);
                 }
 
                 public void OnNext(U value)
                 {
-                    main.HandlerNext();
+                    _main.HandlerNext();
                 }
             }
         }
@@ -158,22 +158,22 @@ namespace System.Reactive.Linq.ObservableImpl
 
     internal sealed class RedoSerializedObserver<X> : IObserver<X>
     {
-        private readonly IObserver<X> downstream;
-        private int wip;
-        private Exception terminalException;
-        private static readonly Exception DONE = new Exception();
-        private static readonly Exception SIGNALED = new Exception();
-        private readonly ConcurrentQueue<X> queue;
+        private readonly IObserver<X> _downstream;
+        private int _wip;
+        private Exception _terminalException;
+        private static readonly Exception DoneIndicator = new Exception();
+        private static readonly Exception SignaledIndicator = new Exception();
+        private readonly ConcurrentQueue<X> _queue;
 
         internal RedoSerializedObserver(IObserver<X> downstream)
         {
-            this.downstream = downstream;
-            queue = new ConcurrentQueue<X>();
+            _downstream = downstream;
+            _queue = new ConcurrentQueue<X>();
         }
 
         public void OnCompleted()
         {
-            if (Interlocked.CompareExchange(ref terminalException, DONE, null) == null)
+            if (Interlocked.CompareExchange(ref _terminalException, DoneIndicator, null) == null)
             {
                 Drain();
             }
@@ -181,7 +181,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         public void OnError(Exception error)
         {
-            if (Interlocked.CompareExchange(ref terminalException, error, null) == null)
+            if (Interlocked.CompareExchange(ref _terminalException, error, null) == null)
             {
                 Drain();
             }
@@ -189,13 +189,13 @@ namespace System.Reactive.Linq.ObservableImpl
 
         public void OnNext(X value)
         {
-            queue.Enqueue(value);
+            _queue.Enqueue(value);
             Drain();
         }
 
         private void Clear()
         {
-            while (queue.TryDequeue(out var _))
+            while (_queue.TryDequeue(out var _))
             {
                 ;
             }
@@ -203,7 +203,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
         private void Drain()
         {
-            if (Interlocked.Increment(ref wip) != 1)
+            if (Interlocked.Increment(ref _wip) != 1)
             {
                 return;
             }
@@ -212,33 +212,33 @@ namespace System.Reactive.Linq.ObservableImpl
 
             for (; ; )
             {
-                var ex = Volatile.Read(ref terminalException);
+                var ex = Volatile.Read(ref _terminalException);
                 if (ex != null)
                 {
-                    if (ex != SIGNALED)
+                    if (ex != SignaledIndicator)
                     {
-                        Interlocked.Exchange(ref terminalException, SIGNALED);
-                        if (ex != DONE)
+                        Interlocked.Exchange(ref _terminalException, SignaledIndicator);
+                        if (ex != DoneIndicator)
                         {
-                            downstream.OnError(ex);
+                            _downstream.OnError(ex);
                         }
                         else
                         {
-                            downstream.OnCompleted();
+                            _downstream.OnCompleted();
                         }
                     }
                     Clear();
                 }
                 else
                 {
-                    while (queue.TryDequeue(out var item))
+                    while (_queue.TryDequeue(out var item))
                     {
-                        downstream.OnNext(item);
+                        _downstream.OnNext(item);
                     }
                 }
 
 
-                missed = Interlocked.Add(ref wip, -missed);
+                missed = Interlocked.Add(ref _wip, -missed);
                 if (missed == 0)
                 {
                     break;

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/SkipUntil.cs

@@ -37,7 +37,7 @@ namespace System.Reactive.Linq.ObservableImpl
             public void Run(SkipUntil<TSource, TOther> parent)
             {
                 Disposable.TrySetSingle(ref _otherDisposable, parent._other.Subscribe(new OtherObserver(this)));
-                base.Run(parent._source);
+                Run(parent._source);
             }
 
             protected override void Dispose(bool disposing)
@@ -171,7 +171,7 @@ namespace System.Reactive.Linq.ObservableImpl
             public void Run(SkipUntil<TSource> parent)
             {
                 Disposable.SetSingle(ref _task, parent._scheduler.Schedule(this, parent._startTime, (_, state) => state.Tick()));
-                base.Run(parent._source);
+                Run(parent._source);
             }
 
             protected override void Dispose(bool disposing)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Take.cs

@@ -123,7 +123,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     _gate = new object();
 
                     Disposable.SetSingle(ref _task, parent._scheduler.Schedule(this, parent._duration, (_, state) => state.Tick()));
-                    base.Run(parent._source);
+                    Run(parent._source);
                 }
 
                 protected override void Dispose(bool disposing)

+ 6 - 6
Rx.NET/Source/src/System.Reactive/Linq/Observable/TakeLast.cs

@@ -114,7 +114,7 @@ namespace System.Reactive.Linq.ObservableImpl
                         n--;
                     }
 
-                    base.Dispose();
+                    Dispose();
                 }
             }
         }
@@ -142,14 +142,14 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 private readonly TimeSpan _duration;
                 private readonly IScheduler _loopScheduler;
-                private Queue<System.Reactive.TimeInterval<TSource>> _queue;
+                private Queue<Reactive.TimeInterval<TSource>> _queue;
 
                 public _(Time parent, IObserver<TSource> observer)
                     : base(observer)
                 {
                     _duration = parent._duration;
                     _loopScheduler = parent._loopScheduler;
-                    _queue = new Queue<System.Reactive.TimeInterval<TSource>>();
+                    _queue = new Queue<Reactive.TimeInterval<TSource>>();
                 }
 
                 private IDisposable _loopDisposable;
@@ -158,7 +158,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 public void Run(IObservable<TSource> source, IScheduler scheduler)
                 {
                     _watch = scheduler.StartStopwatch();
-                    base.Run(source);
+                    Run(source);
                 }
 
                 protected override void Dispose(bool disposing)
@@ -173,7 +173,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 public override void OnNext(TSource value)
                 {
                     var now = _watch.Elapsed;
-                    _queue.Enqueue(new System.Reactive.TimeInterval<TSource>(value, now));
+                    _queue.Enqueue(new Reactive.TimeInterval<TSource>(value, now));
                     Trim(now);
                 }
 
@@ -231,7 +231,7 @@ namespace System.Reactive.Linq.ObservableImpl
                         n--;
                     }
 
-                    base.Dispose();
+                    Dispose();
                 }
 
                 private void Trim(TimeSpan now)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/TakeLastBuffer.cs

@@ -94,7 +94,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 {
                     _watch = scheduler.StartStopwatch();
 
-                    base.Run(source);
+                    Run(source);
                 }
 
                 public override void OnNext(TSource value)

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/Observable/TakeUntil.cs

@@ -36,7 +36,7 @@ namespace System.Reactive.Linq.ObservableImpl
             public void Run(TakeUntil<TSource, TOther> parent)
             {
                 Disposable.SetSingle(ref _otherDisposable, parent._other.Subscribe(new OtherObserver(this)));
-                base.Run(parent._source);
+                Run(parent._source);
             }
 
             protected override void Dispose(bool disposing)
@@ -148,7 +148,7 @@ namespace System.Reactive.Linq.ObservableImpl
             public void Run(TakeUntil<TSource> parent)
             {
                 Disposable.SetSingle(ref _timerDisposable, parent._scheduler.Schedule(this, parent._endTime, (_, state) => state.Tick()));
-                base.Run(parent._source);
+                Run(parent._source);
             }
 
             protected override void Dispose(bool disposing)

+ 4 - 4
Rx.NET/Source/src/System.Reactive/Linq/Observable/TimeInterval.cs

@@ -6,7 +6,7 @@ using System.Reactive.Concurrency;
 
 namespace System.Reactive.Linq.ObservableImpl
 {
-    internal sealed class TimeInterval<TSource> : Producer<System.Reactive.TimeInterval<TSource>, TimeInterval<TSource>._>
+    internal sealed class TimeInterval<TSource> : Producer<Reactive.TimeInterval<TSource>, TimeInterval<TSource>._>
     {
         private readonly IObservable<TSource> _source;
         private readonly IScheduler _scheduler;
@@ -21,9 +21,9 @@ namespace System.Reactive.Linq.ObservableImpl
 
         protected override void Run(_ sink) => sink.Run(this);
 
-        internal sealed class _ : Sink<TSource, System.Reactive.TimeInterval<TSource>>
+        internal sealed class _ : Sink<TSource, Reactive.TimeInterval<TSource>>
         {
-            public _(IObserver<System.Reactive.TimeInterval<TSource>> observer)
+            public _(IObserver<Reactive.TimeInterval<TSource>> observer)
                 : base(observer)
             {
             }
@@ -44,7 +44,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 var now = _watch.Elapsed;
                 var span = now.Subtract(_last);
                 _last = now;
-                ForwardOnNext(new System.Reactive.TimeInterval<TSource>(value, span));
+                ForwardOnNext(new Reactive.TimeInterval<TSource>(value, span));
             }
         }
     }

+ 2 - 3
Rx.NET/Source/src/System.Reactive/Linq/Observable/ToObservable.cs

@@ -5,7 +5,6 @@
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
-using System.Threading;
 
 namespace System.Reactive.Linq.ObservableImpl
 {
@@ -26,9 +25,9 @@ namespace System.Reactive.Linq.ObservableImpl
 
         internal sealed class _ : IdentitySink<TSource>
         {
-            IEnumerator<TSource> _enumerator;
+            private IEnumerator<TSource> _enumerator;
 
-            volatile bool _disposed;
+            private volatile bool _disposed;
 
             public _(IObserver<TSource> observer)
                 : base(observer)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Using.cs

@@ -51,7 +51,7 @@ namespace System.Reactive.Linq.ObservableImpl
                     return;
                 }
 
-                base.Run(source);
+                Run(source);
             }
 
             protected override void Dispose(bool disposing)

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Linq/Observable/Zip.cs

@@ -310,7 +310,7 @@ namespace System.Reactive.Linq.ObservableImpl
                         return;
                     }
 
-                    base.Run(first);
+                    Run(first);
                 }
 
                 protected override void Dispose(bool disposing)

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Linq/ObservableEx.cs

@@ -12,7 +12,9 @@ namespace System.Reactive.Linq
     /// </summary>
     public static class ObservableEx
     {
+#pragma warning disable IDE1006 // Naming Styles: 3rd party code is known to reflect for this specific field name
         private static IQueryLanguageEx s_impl = QueryServices.GetQueryImpl<IQueryLanguageEx>(new QueryLanguageEx());
+#pragma warning restore IDE1006 // Naming Styles
 
         #region Create
 

+ 2 - 0
Rx.NET/Source/src/System.Reactive/Linq/Observable_.cs

@@ -9,6 +9,8 @@ namespace System.Reactive.Linq
     /// </summary>
     public static partial class Observable
     {
+#pragma warning disable IDE1006 // Naming Styles: 3rd party code is known to reflect for this specific field name
         private static IQueryLanguage s_impl = QueryServices.GetQueryImpl<IQueryLanguage>(new QueryLanguage());
+#pragma warning restore IDE1006 // Naming Styles
     }
 }

+ 3 - 1
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs

@@ -1,4 +1,4 @@
-/*
+/*
  * WARNING: Auto-generated file (merged on 06/13/2018)
  * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
  */
@@ -11,7 +11,9 @@ using System.Linq;
 using System.Linq.Expressions;
 using System.Reactive.Concurrency;
 using System.Reactive.Subjects;
+#if !CRIPPLED_REFLECTION
 using System.Reflection;
+#endif
 using System.Threading;
 using System.Threading.Tasks;
 

+ 11 - 9
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Joins.cs

@@ -8,7 +8,9 @@ using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
 using System.Reactive.Joins;
+#if !CRIPPLED_REFLECTION
 using System.Reflection;
+#endif
 
 namespace System.Reactive.Linq
 {
@@ -41,9 +43,9 @@ namespace System.Reactive.Linq
                 Expression.Call(
                     null,
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.And<TLeft, TRight>(default, default)),
+                    InfoOf(() => And<TLeft, TRight>(default, default)),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TLeft), typeof(TRight)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TLeft), typeof(TRight)),
 #endif
                     left.Expression,
                     GetSourceExpression(right)
@@ -76,9 +78,9 @@ namespace System.Reactive.Linq
                 Expression.Call(
                     null,
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.Then<TSource, TResult>(default, default)),
+                    InfoOf(() => Then<TSource, TResult>(default, default)),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource), typeof(TResult)),
 #endif
                     source.Expression,
                     selector
@@ -110,9 +112,9 @@ namespace System.Reactive.Linq
                 Expression.Call(
                     null,
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.When<TResult>(default, default)),
+                    InfoOf(() => When<TResult>(default, default)),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)),
 #endif
                     Expression.Constant(provider, typeof(IQbservableProvider)),
                     Expression.NewArrayInit(
@@ -147,9 +149,9 @@ namespace System.Reactive.Linq
                 Expression.Call(
                     null,
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.When<TResult>(default, default(IEnumerable<QueryablePlan<TResult>>))),
+                    InfoOf(() => When(default, default(IEnumerable<QueryablePlan<TResult>>))),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TResult)),
 #endif
                     Expression.Constant(provider, typeof(IQbservableProvider)),
                     Expression.Constant(plans, typeof(IEnumerable<QueryablePlan<TResult>>))
@@ -159,4 +161,4 @@ namespace System.Reactive.Linq
     }
 }
 
-#pragma warning restore 1591
+#pragma warning restore 1591

+ 4 - 4
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.cs

@@ -54,9 +54,9 @@ namespace System.Reactive.Linq
                 Expression.Call(
                     null,
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.ToQbservable<TSource>(default)),
+                    InfoOf(() => ToQbservable<TSource>(default)),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
                     source.Expression
                 )
@@ -88,9 +88,9 @@ namespace System.Reactive.Linq
                 Expression.Call(
                     null,
 #if CRIPPLED_REFLECTION
-                    InfoOf(() => Qbservable.ToQbservable<TSource>(default)),
+                    InfoOf(() => ToQbservable<TSource>(default)),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
                     source.Expression,
                     Expression.Constant(scheduler)

+ 3 - 1
Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs

@@ -1,4 +1,4 @@
-/*
+/*
  * WARNING: Auto-generated file (05/28/2018 22:20:19)
  * Run Rx's auto-homoiconizer tool to generate this file (in the HomoIcon directory).
  */
@@ -8,7 +8,9 @@
 using System.Collections.Generic;
 using System.Linq.Expressions;
 using System.Reactive.Concurrency;
+#if !CRIPPLED_REFLECTION
 using System.Reflection;
+#endif
 
 namespace System.Reactive.Linq
 {

+ 33 - 33
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs

@@ -23,16 +23,16 @@ namespace System.Reactive.Linq
 
         private sealed class CreateWithDisposableObservable<TSource> : ObservableBase<TSource>
         {
-            private readonly Func<IObserver<TSource>, IDisposable> subscribe;
+            private readonly Func<IObserver<TSource>, IDisposable> _subscribe;
 
             public CreateWithDisposableObservable(Func<IObserver<TSource>, IDisposable> subscribe)
             {
-                this.subscribe = subscribe;
+                _subscribe = subscribe;
             }
 
             protected override IDisposable SubscribeCore(IObserver<TSource> observer)
             {
-                return subscribe(observer) ?? Disposable.Empty;
+                return _subscribe(observer) ?? Disposable.Empty;
             }
         }
 
@@ -43,16 +43,16 @@ namespace System.Reactive.Linq
 
         private sealed class CreateWithActionDisposable<TSource> : ObservableBase<TSource>
         {
-            private readonly Func<IObserver<TSource>, Action> subscribe;
+            private readonly Func<IObserver<TSource>, Action> _subscribe;
 
             public CreateWithActionDisposable(Func<IObserver<TSource>, Action> subscribe)
             {
-                this.subscribe = subscribe;
+                _subscribe = subscribe;
             }
 
             protected override IDisposable SubscribeCore(IObserver<TSource> observer)
             {
-                var a = subscribe(observer);
+                var a = _subscribe(observer);
                 return a != null ? Disposable.Create(a) : Disposable.Empty;
             }
         }
@@ -68,18 +68,18 @@ namespace System.Reactive.Linq
 
         private sealed class CreateWithTaskTokenObservable<TResult> : ObservableBase<TResult>
         {
-            private readonly Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync;
+            private readonly Func<IObserver<TResult>, CancellationToken, Task> _subscribeAsync;
 
             public CreateWithTaskTokenObservable(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync)
             {
-                this.subscribeAsync = subscribeAsync;
+                _subscribeAsync = subscribeAsync;
             }
 
             protected override IDisposable SubscribeCore(IObserver<TResult> observer)
             {
                 var cancellable = new CancellationDisposable();
 
-                var taskObservable = subscribeAsync(observer, cancellable.Token).ToObservable();
+                var taskObservable = _subscribeAsync(observer, cancellable.Token).ToObservable();
                 var taskCompletionObserver = new TaskCompletionObserver(observer);
                 var subscription = taskObservable.Subscribe(taskCompletionObserver);
 
@@ -88,21 +88,21 @@ namespace System.Reactive.Linq
 
             private sealed class TaskCompletionObserver : IObserver<Unit>
             {
-                private readonly IObserver<TResult> observer;
+                private readonly IObserver<TResult> _observer;
 
                 public TaskCompletionObserver(IObserver<TResult> observer)
                 {
-                    this.observer = observer;
+                    _observer = observer;
                 }
 
                 public void OnCompleted()
                 {
-                    observer.OnCompleted();
+                    _observer.OnCompleted();
                 }
 
                 public void OnError(Exception error)
                 {
-                    observer.OnError(error);
+                    _observer.OnError(error);
                 }
 
                 public void OnNext(Unit value)
@@ -124,18 +124,18 @@ namespace System.Reactive.Linq
 
         private sealed class CreateWithTaskDisposable<TResult> : ObservableBase<TResult>
         {
-            private readonly Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> subscribeAsync;
+            private readonly Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> _subscribeAsync;
 
             public CreateWithTaskDisposable(Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> subscribeAsync)
             {
-                this.subscribeAsync = subscribeAsync;
+                _subscribeAsync = subscribeAsync;
             }
 
             protected override IDisposable SubscribeCore(IObserver<TResult> observer)
             {
                 var cancellable = new CancellationDisposable();
 
-                var taskObservable = subscribeAsync(observer, cancellable.Token).ToObservable();
+                var taskObservable = _subscribeAsync(observer, cancellable.Token).ToObservable();
 
                 var taskCompletionObserver = new TaskDisposeCompletionObserver(observer);
 
@@ -150,32 +150,32 @@ namespace System.Reactive.Linq
 
             private sealed class TaskDisposeCompletionObserver : IObserver<IDisposable>, IDisposable
             {
-                private readonly IObserver<TResult> observer;
-                private IDisposable disposable;
+                private readonly IObserver<TResult> _observer;
+                private IDisposable _disposable;
 
                 public TaskDisposeCompletionObserver(IObserver<TResult> observer)
                 {
-                    this.observer = observer;
+                    _observer = observer;
                 }
 
                 public void Dispose()
                 {
-                    Disposable.TryDispose(ref disposable);
+                    Disposable.TryDispose(ref _disposable);
                 }
 
                 public void OnCompleted()
                 {
-                    observer.OnCompleted();
+                    _observer.OnCompleted();
                 }
 
                 public void OnError(Exception error)
                 {
-                    observer.OnError(error);
+                    _observer.OnError(error);
                 }
 
                 public void OnNext(IDisposable value)
                 {
-                    Disposable.SetSingle(ref disposable, value);
+                    Disposable.SetSingle(ref _disposable, value);
                 }
             }
         }
@@ -192,18 +192,18 @@ namespace System.Reactive.Linq
 
         private sealed class CreateWithTaskActionObservable<TResult> : ObservableBase<TResult>
         {
-            private readonly Func<IObserver<TResult>, CancellationToken, Task<Action>> subscribeAsync;
+            private readonly Func<IObserver<TResult>, CancellationToken, Task<Action>> _subscribeAsync;
 
             public CreateWithTaskActionObservable(Func<IObserver<TResult>, CancellationToken, Task<Action>> subscribeAsync)
             {
-                this.subscribeAsync = subscribeAsync;
+                _subscribeAsync = subscribeAsync;
             }
 
             protected override IDisposable SubscribeCore(IObserver<TResult> observer)
             {
                 var cancellable = new CancellationDisposable();
 
-                var taskObservable = subscribeAsync(observer, cancellable.Token).ToObservable();
+                var taskObservable = _subscribeAsync(observer, cancellable.Token).ToObservable();
 
                 var taskCompletionObserver = new TaskDisposeCompletionObserver(observer);
 
@@ -218,33 +218,33 @@ namespace System.Reactive.Linq
 
             private sealed class TaskDisposeCompletionObserver : IObserver<Action>, IDisposable
             {
-                private readonly IObserver<TResult> observer;
-                private Action disposable;
+                private readonly IObserver<TResult> _observer;
+                private Action _disposable;
                 private static readonly Action DisposedAction = () => { };
 
                 public TaskDisposeCompletionObserver(IObserver<TResult> observer)
                 {
-                    this.observer = observer;
+                    _observer = observer;
                 }
 
                 public void Dispose()
                 {
-                    Interlocked.Exchange(ref disposable, DisposedAction)?.Invoke();
+                    Interlocked.Exchange(ref _disposable, DisposedAction)?.Invoke();
                 }
 
                 public void OnCompleted()
                 {
-                    observer.OnCompleted();
+                    _observer.OnCompleted();
                 }
 
                 public void OnError(Exception error)
                 {
-                    observer.OnError(error);
+                    _observer.OnError(error);
                 }
 
                 public void OnNext(Action value)
                 {
-                    if (Interlocked.CompareExchange(ref disposable, value, null) != null)
+                    if (Interlocked.CompareExchange(ref _disposable, value, null) != null)
                     {
                         value?.Invoke();
                     }

+ 20 - 20
Rx.NET/Source/src/System.Reactive/ListObservable.cs

@@ -20,9 +20,9 @@ namespace System.Reactive
     [Experimental]
     public class ListObservable<T> : IList<T>, IObservable<object>
     {
-        private readonly IDisposable subscription;
-        private readonly AsyncSubject<object> subject = new AsyncSubject<object>();
-        private readonly List<T> results = new List<T>();
+        private readonly IDisposable _subscription;
+        private readonly AsyncSubject<object> _subject = new AsyncSubject<object>();
+        private readonly List<T> _results = new List<T>();
 
         /// <summary>
         /// Constructs an object that retains the values of source and signals the end of the sequence.
@@ -36,12 +36,12 @@ namespace System.Reactive
                 throw new ArgumentNullException(nameof(source));
             }
 
-            subscription = source.Subscribe(results.Add, subject.OnError, subject.OnCompleted);
+            _subscription = source.Subscribe(_results.Add, _subject.OnError, _subject.OnCompleted);
         }
 
         private void Wait()
         {
-            subject.DefaultIfEmpty().Wait();
+            _subject.DefaultIfEmpty().Wait();
         }
 
         /// <summary>
@@ -53,12 +53,12 @@ namespace System.Reactive
             {
                 Wait();
 
-                if (results.Count == 0)
+                if (_results.Count == 0)
                 {
                     throw new InvalidOperationException(Strings_Linq.NO_ELEMENTS);
                 }
 
-                return results[results.Count - 1];
+                return _results[_results.Count - 1];
             }
         }
         /// <summary>
@@ -69,7 +69,7 @@ namespace System.Reactive
         public int IndexOf(T item)
         {
             Wait();
-            return results.IndexOf(item);
+            return _results.IndexOf(item);
         }
 
         /// <summary>
@@ -80,7 +80,7 @@ namespace System.Reactive
         public void Insert(int index, T item)
         {
             Wait();
-            results.Insert(index, item);
+            _results.Insert(index, item);
         }
 
         /// <summary>
@@ -90,7 +90,7 @@ namespace System.Reactive
         public void RemoveAt(int index)
         {
             Wait();
-            results.RemoveAt(index);
+            _results.RemoveAt(index);
         }
 
         /// <summary>
@@ -102,12 +102,12 @@ namespace System.Reactive
             get
             {
                 Wait();
-                return results[index];
+                return _results[index];
             }
             set
             {
                 Wait();
-                results[index] = value;
+                _results[index] = value;
             }
         }
 
@@ -118,7 +118,7 @@ namespace System.Reactive
         public void Add(T item)
         {
             Wait();
-            results.Add(item);
+            _results.Add(item);
         }
 
         /// <summary>
@@ -127,7 +127,7 @@ namespace System.Reactive
         public void Clear()
         {
             Wait();
-            results.Clear();
+            _results.Clear();
         }
 
         /// <summary>
@@ -138,7 +138,7 @@ namespace System.Reactive
         public bool Contains(T item)
         {
             Wait();
-            return results.Contains(item);
+            return _results.Contains(item);
         }
 
         /// <summary>
@@ -149,7 +149,7 @@ namespace System.Reactive
         public void CopyTo(T[] array, int arrayIndex)
         {
             Wait();
-            results.CopyTo(array, arrayIndex);
+            _results.CopyTo(array, arrayIndex);
         }
 
         /// <summary>
@@ -160,7 +160,7 @@ namespace System.Reactive
             get
             {
                 Wait();
-                return results.Count;
+                return _results.Count;
             }
         }
 
@@ -180,7 +180,7 @@ namespace System.Reactive
         public bool Remove(T item)
         {
             Wait();
-            return results.Remove(item);
+            return _results.Remove(item);
         }
 
         /// <summary>
@@ -190,7 +190,7 @@ namespace System.Reactive
         public IEnumerator<T> GetEnumerator()
         {
             Wait();
-            return results.GetEnumerator();
+            return _results.GetEnumerator();
         }
 
         IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
@@ -208,7 +208,7 @@ namespace System.Reactive
                 throw new ArgumentNullException(nameof(observer));
             }
 
-            return StableCompositeDisposable.Create(subscription, subject.Subscribe(observer));
+            return StableCompositeDisposable.Create(_subscription, _subject.Subscribe(observer));
         }
     }
 }

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Notification.cs

@@ -141,7 +141,7 @@ namespace System.Reactive
             /// <summary>
             /// Returns a string representation of this instance.
             /// </summary>
-            public override string ToString() => String.Format(CultureInfo.CurrentCulture, "OnNext({0})", Value);
+            public override string ToString() => string.Format(CultureInfo.CurrentCulture, "OnNext({0})", Value);
 
             /// <summary>
             /// Invokes the observer's method corresponding to the notification.
@@ -296,7 +296,7 @@ namespace System.Reactive
             /// <summary>
             /// Returns a string representation of this instance.
             /// </summary>
-            public override string ToString() => String.Format(CultureInfo.CurrentCulture, "OnError({0})", Exception.GetType().FullName);
+            public override string ToString() => string.Format(CultureInfo.CurrentCulture, "OnError({0})", Exception.GetType().FullName);
 
             /// <summary>
             /// Invokes the observer's method corresponding to the notification.

+ 4 - 4
Rx.NET/Source/src/System.Reactive/ObservableQuery.cs

@@ -71,18 +71,18 @@ namespace System.Reactive
             return Expression.Lambda<Func<IQueryable<TElement>>>(res).Compile()();
         }
 
-        private static MethodInfo s_AsQueryable;
+        private static MethodInfo _staticAsQueryable;
 
         private static MethodInfo AsQueryable
         {
             get
             {
-                if (s_AsQueryable == null)
+                if (_staticAsQueryable == null)
                 {
-                    s_AsQueryable = Qbservable.InfoOf<object>(() => Queryable.AsQueryable<object>(null)).GetGenericMethodDefinition();
+                    _staticAsQueryable = Qbservable.InfoOf<object>(() => Queryable.AsQueryable<object>(null)).GetGenericMethodDefinition();
                 }
 
-                return s_AsQueryable;
+                return _staticAsQueryable;
             }
         }
 

+ 7 - 7
Rx.NET/Source/src/System.Reactive/ObserverBase.cs

@@ -13,14 +13,14 @@ namespace System.Reactive
     /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
     public abstract class ObserverBase<T> : IObserver<T>, IDisposable
     {
-        private int isStopped;
+        private int _isStopped;
 
         /// <summary>
         /// Creates a new observer in a non-stopped state.
         /// </summary>
         protected ObserverBase()
         {
-            isStopped = 0;
+            _isStopped = 0;
         }
 
         /// <summary>
@@ -29,7 +29,7 @@ namespace System.Reactive
         /// <param name="value">Next element in the sequence.</param>
         public void OnNext(T value)
         {
-            if (Volatile.Read(ref isStopped) == 0)
+            if (Volatile.Read(ref _isStopped) == 0)
             {
                 OnNextCore(value);
             }
@@ -54,7 +54,7 @@ namespace System.Reactive
                 throw new ArgumentNullException(nameof(error));
             }
 
-            if (Interlocked.Exchange(ref isStopped, 1) == 0)
+            if (Interlocked.Exchange(ref _isStopped, 1) == 0)
             {
                 OnErrorCore(error);
             }
@@ -73,7 +73,7 @@ namespace System.Reactive
         /// </summary>
         public void OnCompleted()
         {
-            if (Interlocked.Exchange(ref isStopped, 1) == 0)
+            if (Interlocked.Exchange(ref _isStopped, 1) == 0)
             {
                 OnCompletedCore();
             }
@@ -102,13 +102,13 @@ namespace System.Reactive
         {
             if (disposing)
             {
-                Volatile.Write(ref isStopped, 1);
+                Volatile.Write(ref _isStopped, 1);
             }
         }
 
         internal bool Fail(Exception error)
         {
-            if (Interlocked.Exchange(ref isStopped, 1) == 0)
+            if (Interlocked.Exchange(ref _isStopped, 1) == 0)
             {
                 OnErrorCore(error);
                 return true;

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Concurrency/ControlScheduler.cs

@@ -21,7 +21,7 @@ namespace System.Reactive.Concurrency
         /// <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="System.Reactive.Linq.ControlObservable.ObserveOn{TSource}"/> and <see cref="System.Reactive.Linq.ControlObservable.SubscribeOn{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)
         {
@@ -95,7 +95,7 @@ namespace System.Reactive.Concurrency
             {
                 var d = new MultipleAssignmentDisposable();
 
-                var timer = new System.Windows.Forms.Timer();
+                var timer = new Windows.Forms.Timer();
 
                 timer.Tick += (s, e) =>
                 {
@@ -174,7 +174,7 @@ namespace System.Reactive.Concurrency
 
             var createTimer = new Func<IScheduler, TState, IDisposable>((scheduler1, state1) =>
             {
-                var timer = new System.Windows.Forms.Timer();
+                var timer = new Windows.Forms.Timer();
 
                 timer.Tick += (s, e) =>
                 {

+ 17 - 17
Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Concurrency/DispatcherScheduler.cs

@@ -9,27 +9,27 @@ using System.Threading;
 namespace System.Reactive.Concurrency
 {
     /// <summary>
-    /// Represents an object that schedules units of work on a <see cref="System.Windows.Threading.Dispatcher"/>.
+    /// Represents an object that schedules units of work on a <see cref="Windows.Threading.Dispatcher"/>.
     /// </summary>
     /// <remarks>
-    /// This scheduler type is typically used indirectly through the <see cref="System.Reactive.Linq.DispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource})"/> and <see cref="System.Reactive.Linq.DispatcherObservable.SubscribeOnDispatcher{TSource}(IObservable{TSource})"/> methods that use the Dispatcher on the calling thread.
+    /// This scheduler type is typically used indirectly through the <see cref="Linq.DispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource})"/> and <see cref="Linq.DispatcherObservable.SubscribeOnDispatcher{TSource}(IObservable{TSource})"/> methods that use the Dispatcher on the calling thread.
     /// </remarks>
     public class DispatcherScheduler : LocalScheduler, ISchedulerPeriodic
     {
         /// <summary>
-        /// Gets the scheduler that schedules work on the current <see cref="System.Windows.Threading.Dispatcher"/>.
+        /// Gets the scheduler that schedules work on the current <see cref="Windows.Threading.Dispatcher"/>.
         /// </summary>
         [Obsolete(Constants_WindowsThreading.OBSOLETE_INSTANCE_PROPERTY)]
-        public static DispatcherScheduler Instance => new DispatcherScheduler(System.Windows.Threading.Dispatcher.CurrentDispatcher);
+        public static DispatcherScheduler Instance => new DispatcherScheduler(Windows.Threading.Dispatcher.CurrentDispatcher);
 
         /// <summary>
-        /// Gets the scheduler that schedules work on the <see cref="System.Windows.Threading.Dispatcher"/> for the current thread.
+        /// Gets the scheduler that schedules work on the <see cref="Windows.Threading.Dispatcher"/> for the current thread.
         /// </summary>
         public static DispatcherScheduler Current
         {
             get
             {
-                var dispatcher = System.Windows.Threading.Dispatcher.FromThread(Thread.CurrentThread);
+                var dispatcher = Windows.Threading.Dispatcher.FromThread(Thread.CurrentThread);
                 if (dispatcher == null)
                 {
                     throw new InvalidOperationException(Strings_WindowsThreading.NO_DISPATCHER_CURRENT_THREAD);
@@ -40,11 +40,11 @@ namespace System.Reactive.Concurrency
         }
 
         /// <summary>
-        /// Constructs a <see cref="DispatcherScheduler"/> that schedules units of work on the given <see cref="System.Windows.Threading.Dispatcher"/>.
+        /// Constructs a <see cref="DispatcherScheduler"/> that schedules units of work on the given <see cref="Windows.Threading.Dispatcher"/>.
         /// </summary>
         /// <param name="dispatcher"><see cref="DispatcherScheduler"/> to schedule work on.</param>
         /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is <c>null</c>.</exception>
-        public DispatcherScheduler(System.Windows.Threading.Dispatcher dispatcher)
+        public DispatcherScheduler(Windows.Threading.Dispatcher dispatcher)
         {
             Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
             Priority = Windows.Threading.DispatcherPriority.Normal;
@@ -52,26 +52,26 @@ namespace System.Reactive.Concurrency
         }
 
         /// <summary>
-        /// Constructs a <see cref="DispatcherScheduler"/> that schedules units of work on the given <see cref="System.Windows.Threading.Dispatcher"/> at the given priority.
+        /// Constructs a <see cref="DispatcherScheduler"/> that schedules units of work on the given <see cref="Windows.Threading.Dispatcher"/> at the given priority.
         /// </summary>
         /// <param name="dispatcher"><see cref="DispatcherScheduler"/> to schedule work on.</param>
         /// <param name="priority">Priority at which units of work are scheduled.</param>
         /// <exception cref="ArgumentNullException"><paramref name="dispatcher"/> is <c>null</c>.</exception>
-        public DispatcherScheduler(System.Windows.Threading.Dispatcher dispatcher, System.Windows.Threading.DispatcherPriority priority)
+        public DispatcherScheduler(Windows.Threading.Dispatcher dispatcher, Windows.Threading.DispatcherPriority priority)
         {
             Dispatcher = dispatcher ?? throw new ArgumentNullException(nameof(dispatcher));
             Priority = priority;
         }
 
         /// <summary>
-        /// Gets the <see cref="System.Windows.Threading.Dispatcher"/> associated with the <see cref="DispatcherScheduler"/>.
+        /// Gets the <see cref="Windows.Threading.Dispatcher"/> associated with the <see cref="DispatcherScheduler"/>.
         /// </summary>
-        public System.Windows.Threading.Dispatcher Dispatcher { get; }
+        public Windows.Threading.Dispatcher Dispatcher { get; }
 
         /// <summary>
         /// Gets the priority at which work items will be dispatched.
         /// </summary>
-        public System.Windows.Threading.DispatcherPriority Priority { get; }
+        public Windows.Threading.DispatcherPriority Priority { get; }
 
         /// <summary>
         /// Schedules an action to be executed on the dispatcher.
@@ -105,7 +105,7 @@ namespace System.Reactive.Concurrency
         }
 
         /// <summary>
-        /// Schedules an action to be executed after <paramref name="dueTime"/> on the dispatcher, using a <see cref="System.Windows.Threading.DispatcherTimer"/> object.
+        /// Schedules an action to be executed after <paramref name="dueTime"/> on the dispatcher, using a <see cref="Windows.Threading.DispatcherTimer"/> 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>
@@ -133,7 +133,7 @@ namespace System.Reactive.Concurrency
         {
             var d = new MultipleAssignmentDisposable();
 
-            var timer = new System.Windows.Threading.DispatcherTimer(Priority, Dispatcher);
+            var timer = new Windows.Threading.DispatcherTimer(Priority, Dispatcher);
 
             timer.Tick += (s, e) =>
             {
@@ -169,7 +169,7 @@ namespace System.Reactive.Concurrency
         }
 
         /// <summary>
-        /// Schedules a periodic piece of work on the dispatcher, using a <see cref="System.Windows.Threading.DispatcherTimer"/> object.
+        /// Schedules a periodic piece of work on the dispatcher, using a <see cref="Windows.Threading.DispatcherTimer"/> 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>
@@ -190,7 +190,7 @@ namespace System.Reactive.Concurrency
                 throw new ArgumentNullException(nameof(action));
             }
 
-            var timer = new System.Windows.Threading.DispatcherTimer(Priority, Dispatcher);
+            var timer = new Windows.Threading.DispatcherTimer(Priority, Dispatcher);
 
             var state1 = state;
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/ControlObservable.cs

@@ -22,7 +22,7 @@ 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="ControlObservable.ObserveOn"/>.
+        /// 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> SubscribeOn<TSource>(this IObservable<TSource> source, Control control)
         {

+ 14 - 14
Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/DispatcherObservable.cs

@@ -35,7 +35,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcher));
             }
 
-            return ObserveOn_<TSource>(source, dispatcher);
+            return ObserveOn_(source, dispatcher);
         }
 
         /// <summary>
@@ -59,7 +59,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcher));
             }
 
-            return ObserveOn_<TSource>(source, dispatcher, priority);
+            return ObserveOn_(source, dispatcher, priority);
         }
 
         /// <summary>
@@ -82,7 +82,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(scheduler));
             }
 
-            return ObserveOn_<TSource>(source, scheduler.Dispatcher, scheduler.Priority);
+            return ObserveOn_(source, scheduler.Dispatcher, scheduler.Priority);
         }
 
 
@@ -106,7 +106,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcherObject));
             }
 
-            return ObserveOn_<TSource>(source, dispatcherObject.Dispatcher);
+            return ObserveOn_(source, dispatcherObject.Dispatcher);
         }
 
         /// <summary>
@@ -130,7 +130,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcherObject));
             }
 
-            return ObserveOn_<TSource>(source, dispatcherObject.Dispatcher, priority);
+            return ObserveOn_(source, dispatcherObject.Dispatcher, priority);
         }
 
 
@@ -148,7 +148,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return ObserveOn_<TSource>(source, DispatcherScheduler.Current.Dispatcher);
+            return ObserveOn_(source, DispatcherScheduler.Current.Dispatcher);
         }
 
         /// <summary>
@@ -166,7 +166,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return ObserveOn_<TSource>(source, DispatcherScheduler.Current.Dispatcher, priority);
+            return ObserveOn_(source, DispatcherScheduler.Current.Dispatcher, priority);
         }
 
         private static IObservable<TSource> ObserveOn_<TSource>(IObservable<TSource> source, Dispatcher dispatcher, DispatcherPriority priority)
@@ -208,7 +208,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcher));
             }
 
-            return SubscribeOn_<TSource>(source, dispatcher);
+            return SubscribeOn_(source, dispatcher);
         }
 
         /// <summary>
@@ -236,7 +236,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcher));
             }
 
-            return SubscribeOn_<TSource>(source, dispatcher, priority);
+            return SubscribeOn_(source, dispatcher, priority);
         }
 
 
@@ -264,7 +264,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(scheduler));
             }
 
-            return SubscribeOn_<TSource>(source, scheduler.Dispatcher, scheduler.Priority);
+            return SubscribeOn_(source, scheduler.Dispatcher, scheduler.Priority);
         }
 
         /// <summary>
@@ -291,7 +291,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcherObject));
             }
 
-            return SubscribeOn_<TSource>(source, dispatcherObject.Dispatcher);
+            return SubscribeOn_(source, dispatcherObject.Dispatcher);
         }
 
         /// <summary>
@@ -319,7 +319,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(dispatcherObject));
             }
 
-            return SubscribeOn_<TSource>(source, dispatcherObject.Dispatcher, priority);
+            return SubscribeOn_(source, dispatcherObject.Dispatcher, priority);
         }
 
         /// <summary>
@@ -340,7 +340,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return SubscribeOn_<TSource>(source, DispatcherScheduler.Current.Dispatcher);
+            return SubscribeOn_(source, DispatcherScheduler.Current.Dispatcher);
         }
 
         /// <summary>
@@ -362,7 +362,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return SubscribeOn_<TSource>(source, DispatcherScheduler.Current.Dispatcher, priority);
+            return SubscribeOn_(source, DispatcherScheduler.Current.Dispatcher, priority);
         }
 
         private static IObservable<TSource> SubscribeOn_<TSource>(IObservable<TSource> source, Dispatcher dispatcher, DispatcherPriority priority)

+ 8 - 8
Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/Observable.Remoting.cs

@@ -23,7 +23,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence.</param>
         /// <returns>The observable sequence that supports remote subscriptions.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
+        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
         public static IObservable<TSource> Remotable<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
@@ -31,7 +31,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return Remotable_<TSource>(source);
+            return Remotable_(source);
         }
 
         /// <summary>
@@ -42,7 +42,7 @@ namespace System.Reactive.Linq
         /// <param name="lease">Lease object to control lifetime of the remotable sequence. Notice null is a supported value.</param>
         /// <returns>The observable sequence that supports remote subscriptions.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
+        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
         public static IObservable<TSource> Remotable<TSource>(this IObservable<TSource> source, ILease lease)
         {
             if (source == null)
@@ -50,7 +50,7 @@ namespace System.Reactive.Linq
                 throw new ArgumentNullException(nameof(source));
             }
 
-            return Remotable_<TSource>(source, lease);
+            return Remotable_(source, lease);
         }
 
         /// <summary>
@@ -60,7 +60,7 @@ namespace System.Reactive.Linq
         /// <param name="source">Source sequence.</param>
         /// <returns>The observable sequence that supports remote subscriptions.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
+        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
         public static IQbservable<TSource> Remotable<TSource>(this IQbservable<TSource> source)
         {
             if (source == null)
@@ -74,7 +74,7 @@ namespace System.Reactive.Linq
 #if CRIPPLED_REFLECTION
                     InfoOf(() => RemotingObservable.Remotable<TSource>(default(IQbservable<TSource>))),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
                     source.Expression
                 )
@@ -89,7 +89,7 @@ namespace System.Reactive.Linq
         /// <param name="lease">Lease object to control lifetime of the remotable sequence. Notice null is a supported value.</param>
         /// <returns>The observable sequence that supports remote subscriptions.</returns>
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
-        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
+        [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Remotable", Justification = "In honor of the .NET Remoting heroes.")]
         public static IQbservable<TSource> Remotable<TSource>(this IQbservable<TSource> source, ILease lease)
         {
             if (source == null)
@@ -103,7 +103,7 @@ namespace System.Reactive.Linq
 #if CRIPPLED_REFLECTION
                     InfoOf(() => RemotingObservable.Remotable<TSource>(default(IQbservable<TSource>), default(ILease))),
 #else
-                    ((MethodInfo)MethodInfo.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
+                    ((MethodInfo)MethodBase.GetCurrentMethod()).MakeGenericMethod(typeof(TSource)),
 #endif
                     source.Expression,
                     Expression.Constant(lease, typeof(ILease))

+ 17 - 17
Rx.NET/Source/src/System.Reactive/Platforms/Desktop/Linq/QueryLanguage.Remoting.cs

@@ -76,11 +76,11 @@ namespace System.Reactive.Linq
         [Serializable]
         private class SerializableObservable<T> : IObservable<T>
         {
-            private readonly RemotableObservable<T> remotableObservable;
+            private readonly RemotableObservable<T> _remotableObservable;
 
             public SerializableObservable(RemotableObservable<T> remotableObservable)
             {
-                this.remotableObservable = remotableObservable;
+                _remotableObservable = remotableObservable;
             }
 
             public IDisposable Subscribe(IObserver<T> observer)
@@ -90,7 +90,7 @@ namespace System.Reactive.Linq
                 //
                 // [OK] Use of unsafe Subscribe: non-pretentious transparent wrapping through remoting; exception coming from the remote object is not re-routed.
                 //
-                var d = remotableObservable.Subscribe/*Unsafe*/(new RemotableObserver<T>(consumer));
+                var d = _remotableObservable.Subscribe/*Unsafe*/(new RemotableObserver<T>(consumer));
 
                 consumer.SetResource(d);
 
@@ -100,23 +100,23 @@ namespace System.Reactive.Linq
 
         private class RemotableObserver<T> : MarshalByRefObject, IObserver<T>, ISponsor
         {
-            private readonly IObserver<T> underlyingObserver;
+            private readonly IObserver<T> _underlyingObserver;
 
             public RemotableObserver(IObserver<T> underlyingObserver)
             {
-                this.underlyingObserver = underlyingObserver;
+                _underlyingObserver = underlyingObserver;
             }
 
             public void OnNext(T value)
             {
-                underlyingObserver.OnNext(value);
+                _underlyingObserver.OnNext(value);
             }
 
             public void OnError(Exception exception)
             {
                 try
                 {
-                    underlyingObserver.OnError(exception);
+                    _underlyingObserver.OnError(exception);
                 }
                 finally
                 {
@@ -128,7 +128,7 @@ namespace System.Reactive.Linq
             {
                 try
                 {
-                    underlyingObserver.OnCompleted();
+                    _underlyingObserver.OnCompleted();
                 }
                 finally
                 {
@@ -164,13 +164,13 @@ namespace System.Reactive.Linq
         [Serializable]
         private sealed class RemotableObservable<T> : MarshalByRefObject, IObservable<T>
         {
-            private readonly IObservable<T> underlyingObservable;
-            private readonly ILease lease;
+            private readonly IObservable<T> _underlyingObservable;
+            private readonly ILease _lease;
 
             public RemotableObservable(IObservable<T> underlyingObservable, ILease lease)
             {
-                this.underlyingObservable = underlyingObservable;
-                this.lease = lease;
+                _underlyingObservable = underlyingObservable;
+                _lease = lease;
             }
 
             public IDisposable Subscribe(IObserver<T> observer)
@@ -178,22 +178,22 @@ namespace System.Reactive.Linq
                 //
                 // [OK] Use of unsafe Subscribe: non-pretentious transparent wrapping through remoting; throwing across remoting boundaries is fine.
                 //
-                return new RemotableSubscription(underlyingObservable.Subscribe/*Unsafe*/(observer));
+                return new RemotableSubscription(_underlyingObservable.Subscribe/*Unsafe*/(observer));
             }
 
             [SecurityCritical]
             public override object InitializeLifetimeService()
             {
-                return lease;
+                return _lease;
             }
 
             private sealed class RemotableSubscription : MarshalByRefObject, IDisposable, ISponsor
             {
-                private IDisposable underlyingSubscription;
+                private IDisposable _underlyingSubscription;
 
                 public RemotableSubscription(IDisposable underlyingSubscription)
                 {
-                    this.underlyingSubscription = underlyingSubscription;
+                    _underlyingSubscription = underlyingSubscription;
                 }
 
                 public void Dispose()
@@ -201,7 +201,7 @@ namespace System.Reactive.Linq
                     //
                     // Avoiding double-dispose and dropping the reference upon disposal.
                     //
-                    using (Interlocked.Exchange(ref underlyingSubscription, Disposable.Empty))
+                    using (Interlocked.Exchange(ref _underlyingSubscription, Disposable.Empty))
                     {
                         Unregister();
                     }

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Platforms/UWP/Concurrency/CoreDispatcherScheduler.cs

@@ -15,7 +15,7 @@ namespace System.Reactive.Concurrency
     /// Represents an object that schedules units of work on a <see cref="CoreDispatcher"/>.
     /// </summary>
     /// <remarks>
-    /// This scheduler type is typically used indirectly through the <see cref="System.Reactive.Linq.DispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource})"/> and <see cref="System.Reactive.Linq.DispatcherObservable.SubscribeOnDispatcher{TSource}(IObservable{TSource})"/> methods that use the current Dispatcher.
+    /// This scheduler type is typically used indirectly through the <see cref="Linq.DispatcherObservable.ObserveOnDispatcher{TSource}(IObservable{TSource})"/> and <see cref="Linq.DispatcherObservable.SubscribeOnDispatcher{TSource}(IObservable{TSource})"/> methods that use the current Dispatcher.
     /// </remarks>
     [CLSCompliant(false)]
     public sealed class CoreDispatcherScheduler : LocalScheduler, ISchedulerPeriodic

+ 3 - 3
Rx.NET/Source/src/System.Reactive/Platforms/UWP/Linq/WindowsObservable.Events.cs

@@ -22,7 +22,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="WindowsObservable.ToEventPattern"/>
+        /// <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)
@@ -62,7 +62,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="WindowsObservable.ToEventPattern"/>
+        /// <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)
@@ -115,4 +115,4 @@ namespace System.Reactive.Linq
         }
     }
 }
-#endif
+#endif

+ 10 - 10
Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs

@@ -98,8 +98,8 @@ namespace System.Reactive.Subjects
                         {
                             if (!o.IsDisposed())
                             {
-                                o.downstream.OnNext(value);
-                                o.downstream.OnCompleted();
+                                o.Downstream.OnNext(value);
+                                o.Downstream.OnCompleted();
                             }
                         }
                     }
@@ -109,7 +109,7 @@ namespace System.Reactive.Subjects
                         {
                             if (!o.IsDisposed())
                             {
-                                o.downstream.OnCompleted();
+                                o.Downstream.OnCompleted();
                             }
                         }
                     }
@@ -151,7 +151,7 @@ namespace System.Reactive.Subjects
                     {
                         if (!o.IsDisposed())
                         {
-                            o.downstream.OnError(error);
+                            o.Downstream.OnError(error);
                         }
                     }
                 }
@@ -304,23 +304,23 @@ namespace System.Reactive.Subjects
         /// </summary>
         private sealed class AsyncSubjectDisposable : IDisposable
         {
-            internal readonly IObserver<T> downstream;
-            private AsyncSubject<T> parent;
+            internal readonly IObserver<T> Downstream;
+            private AsyncSubject<T> _parent;
 
             public AsyncSubjectDisposable(AsyncSubject<T> parent, IObserver<T> downstream)
             {
-                this.parent = parent;
-                this.downstream = downstream;
+                _parent = parent;
+                Downstream = downstream;
             }
 
             public void Dispose()
             {
-                Interlocked.Exchange(ref parent, null)?.Remove(this);
+                Interlocked.Exchange(ref _parent, null)?.Remove(this);
             }
 
             internal bool IsDisposed()
             {
-                return Volatile.Read(ref parent) == null;
+                return Volatile.Read(ref _parent) == null;
             }
         }
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/TimeInterval.cs

@@ -101,7 +101,7 @@ namespace System.Reactive
         /// <returns>String representation of the current <see cref="TimeInterval{T}"/> value.</returns>
         public override string ToString()
         {
-            return String.Format(CultureInfo.CurrentCulture, "{0}@{1}", Value, Interval);
+            return string.Format(CultureInfo.CurrentCulture, "{0}@{1}", Value, Interval);
         }
     }
 }

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Timestamped.cs

@@ -102,7 +102,7 @@ namespace System.Reactive
         /// <returns>String representation of the current <see cref="Timestamped{T}" /> value.</returns>
         public override string ToString()
         {
-            return String.Format(CultureInfo.CurrentCulture, "{0}@{1}", Value, Timestamp);
+            return string.Format(CultureInfo.CurrentCulture, "{0}@{1}", Value, Timestamp);
         }
     }
 

Some files were not shown because too many files changed in this diff