Browse Source

Merge branch 'develop' of https://github.com/Reactive-Extensions/Rx.NET into RemoveWindowsPhone7

Bart De Smet 8 năm trước cách đây
mục cha
commit
ca8ea6fc96
100 tập tin đã thay đổi với 672 bổ sung1914 xóa
  1. 0 7
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/Observable.Aliases.cs
  2. 5 27
      Rx.NET/Source/src/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs
  3. 3 3
      Rx.NET/Source/src/System.Reactive/AnonymousObservable.cs
  4. 23 35
      Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs
  5. 1 1
      Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs
  6. 0 10
      Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs
  7. 0 44
      Rx.NET/Source/src/System.Reactive/Concurrency/CurrentThreadScheduler.cs
  8. 0 10
      Rx.NET/Source/src/System.Reactive/Concurrency/DisableOptimizationsScheduler.cs
  9. 0 16
      Rx.NET/Source/src/System.Reactive/Concurrency/EventLoopScheduler.cs
  10. 3 10
      Rx.NET/Source/src/System.Reactive/Concurrency/ScheduledItem.cs
  11. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs
  12. 7 49
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs
  13. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskHelpers.cs
  14. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.cs
  15. 1 4
      Rx.NET/Source/src/System.Reactive/Disposables/AnonymousDisposable.cs
  16. 1 4
      Rx.NET/Source/src/System.Reactive/Disposables/BooleanDisposable.cs
  17. 5 16
      Rx.NET/Source/src/System.Reactive/Disposables/CancellationDisposable.cs
  18. 38 41
      Rx.NET/Source/src/System.Reactive/Disposables/CompositeDisposable.cs
  19. 4 11
      Rx.NET/Source/src/System.Reactive/Disposables/ContextDisposable.cs
  20. 3 6
      Rx.NET/Source/src/System.Reactive/Disposables/Disposable.cs
  21. 9 1
      Rx.NET/Source/src/System.Reactive/Disposables/MultipleAssignmentDisposable.cs
  22. 5 12
      Rx.NET/Source/src/System.Reactive/Disposables/RefCountDisposable.cs
  23. 6 14
      Rx.NET/Source/src/System.Reactive/Disposables/ScheduledDisposable.cs
  24. 8 6
      Rx.NET/Source/src/System.Reactive/Disposables/SerialDisposable.cs
  25. 5 6
      Rx.NET/Source/src/System.Reactive/Disposables/SingleAssignmentDisposable.cs
  26. 6 27
      Rx.NET/Source/src/System.Reactive/Disposables/StableCompositeDisposable.cs
  27. 2 2
      Rx.NET/Source/src/System.Reactive/EnlightenmentProvider.cs
  28. 15 24
      Rx.NET/Source/src/System.Reactive/EventPattern.cs
  29. 1 1
      Rx.NET/Source/src/System.Reactive/EventPatternSource.cs
  30. 17 9
      Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs
  31. 12 4
      Rx.NET/Source/src/System.Reactive/EventSource.cs
  32. 1 1
      Rx.NET/Source/src/System.Reactive/ExcludeFromCodeCoverageAttribute.cs
  33. 0 2
      Rx.NET/Source/src/System.Reactive/Internal/CurrentPlatformEnlightenmentProvider.cs
  34. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/PushPullAdapter.cs
  35. 1 1
      Rx.NET/Source/src/System.Reactive/Internal/ScheduledObserver.cs
  36. 0 46
      Rx.NET/Source/src/System.Reactive/Internal/SystemClock.cs
  37. 0 375
      Rx.NET/Source/src/System.Reactive/Linq/ExpressionVisitor.cs
  38. 0 2
      Rx.NET/Source/src/System.Reactive/Linq/IQbservable.cs
  39. 0 2
      Rx.NET/Source/src/System.Reactive/Linq/IQbservableProvider.cs
  40. 1 27
      Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.cs
  41. 108 108
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Aggregates.cs
  42. 0 4
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Async.cs
  43. 0 11
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Creation.cs
  44. 0 5
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Imperative.cs
  45. 0 15
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs
  46. 0 7
      Rx.NET/Source/src/System.Reactive/Linq/Observable.StandardSequenceOperators.cs
  47. 0 33
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Delay.cs
  48. 1 1
      Rx.NET/Source/src/System.Reactive/Linq/Observable/GetEnumerator.cs
  49. 0 56
      Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs
  50. 0 14
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Latest.cs
  51. 1 11
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Merge.cs
  52. 0 14
      Rx.NET/Source/src/System.Reactive/Linq/Observable/Next.cs
  53. 6 23
      Rx.NET/Source/src/System.Reactive/Linq/Observable/SelectMany.cs
  54. 101 141
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs
  55. 0 4
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.cs
  56. 1 7
      Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs
  57. 0 2
      Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.cs
  58. 0 11
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Async.cs
  59. 2 2
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs
  60. 2 13
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Creation.cs
  61. 2 7
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Imperative.cs
  62. 0 9
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Multiple.cs
  63. 0 8
      Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs
  64. 13 10
      Rx.NET/Source/src/System.Reactive/ListObservable.cs
  65. 7 7
      Rx.NET/Source/src/System.Reactive/NamespaceDocs.cs
  66. 62 99
      Rx.NET/Source/src/System.Reactive/Notification.cs
  67. 34 28
      Rx.NET/Source/src/System.Reactive/Observable.Extensions.cs
  68. 2 2
      Rx.NET/Source/src/System.Reactive/ObservableBase.cs
  69. 2 8
      Rx.NET/Source/src/System.Reactive/ObservableQuery.cs
  70. 6 4
      Rx.NET/Source/src/System.Reactive/ObserverBase.cs
  71. 2 11
      Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
  72. 1 7
      Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs
  73. 1 1
      Rx.NET/Source/src/System.Reactive/Threading/Tasks/NamespaceDoc.cs
  74. 36 34
      Rx.NET/Source/src/System.Reactive/Threading/Tasks/TaskObservableExtensions.cs
  75. 12 23
      Rx.NET/Source/src/System.Reactive/TimeInterval.cs
  76. 12 23
      Rx.NET/Source/src/System.Reactive/Timestamped.cs
  77. 26 46
      Rx.NET/Source/src/System.Reactive/Unit.cs
  78. 0 50
      Rx.NET/Source/tests/Tests.System.Reactive/App.cs
  79. 0 4
      Rx.NET/Source/tests/Tests.System.Reactive/Stress/Core/Schedulers/EventLoop.cs
  80. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/Stress/Linq/ReplaySubject.cs
  81. 0 42
      Rx.NET/Source/tests/Tests.System.Reactive/TestBase.cs
  82. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/TestTaskScheduler.cs
  83. 0 3
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/AsyncLockTest.cs
  84. 0 3
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/CurrentThreadSchedulerTest.cs
  85. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DefaultSchedulerTest.cs
  86. 0 10
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DispatcherSchedulerTest.cs
  87. 1 5
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs
  88. 2 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ImmediateSchedulerTest.cs
  89. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs
  90. 0 8
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs
  91. 1 3
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SynchronizationContextSchedulerTest.cs
  92. 0 6
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SynchronizationTest.cs
  93. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.cs
  94. 0 4
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs
  95. 1 1
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/VirtualSchedulerTest.cs
  96. 0 2
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs
  97. 1 14
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableAsyncTest.cs
  98. 23 40
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableBlockingTest.cs
  99. 18 28
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConcurrencyTest.cs
  100. 0 8
      Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConversionTests.cs

+ 0 - 7
Rx.NET/Source/src/System.Reactive.Observable.Aliases/Observable.Aliases.cs

@@ -8,12 +8,9 @@ using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Reactive.Linq;
 using System.Reactive;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks; // needed for doc comments
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 /*
  * Note: these methods just call methods in Observable.StandardSequenceOperators.cs
@@ -108,7 +105,6 @@ namespace System.Reactive.Observable.Aliases
             return source.SelectMany<TSource, TResult>(selector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -172,7 +168,6 @@ namespace System.Reactive.Observable.Aliases
         {
             return source.SelectMany<TSource, TResult>(selector);
         }
-#endif
 
         /// <summary>
         /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
@@ -208,7 +203,6 @@ namespace System.Reactive.Observable.Aliases
             return source.SelectMany<TSource, TCollection, TResult>(collectionSelector, resultSelector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -280,7 +274,6 @@ namespace System.Reactive.Observable.Aliases
         {
             return source.SelectMany<TSource, TTaskResult, TResult>(taskSelector, resultSelector);
         }
-#endif
 
         /// <summary>
         /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.

+ 5 - 27
Rx.NET/Source/src/System.Reactive.Observable.Aliases/Qbservable.Aliases.Generated.cs

@@ -5,22 +5,18 @@
 
 #pragma warning disable 1591
 
-#if !NO_EXPRESSIONS
-
 using System;
-using System.Reactive.Concurrency;
 using System.Collections.Generic;
-using System.Reactive.Joins;
+using System.Diagnostics.CodeAnalysis;
 using System.Linq;
 using System.Linq.Expressions;
-using System.Reflection;
-using System.Threading;
 using System.Reactive;
+using System.Reactive.Concurrency;
+using System.Reactive.Joins;
 using System.Reactive.Subjects;
-using System.Diagnostics.CodeAnalysis;
-#if !NO_TPL
+using System.Reflection;
+using System.Threading;
 using System.Threading.Tasks;
-#endif
 #if !NO_REMOTING
 using System.Runtime.Remoting.Lifetime;
 #endif
@@ -218,7 +214,6 @@ namespace System.Reactive.Linq
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -235,9 +230,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -254,9 +247,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -273,9 +264,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support and merges all of the task results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -292,7 +281,6 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
         
         /// <summary>
         /// Projects each element of an observable sequence to an enumerable sequence and concatenates the resulting enumerable sequences into one observable sequence.
@@ -328,7 +316,6 @@ namespace System.Reactive.Linq
             return Qbservable.SelectMany<TSource, TResult>(source, selector);
         }
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -347,9 +334,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -368,9 +353,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -389,9 +372,7 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task by incorporating the element's index with cancellation support, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// Synonym for the method 'SelectMany'
@@ -410,7 +391,6 @@ namespace System.Reactive.Linq
         {
             return Qbservable.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
         
         /// <summary>
         /// Projects each element of an observable sequence into a new form. Synonym for the method 'Select'
@@ -445,7 +425,5 @@ namespace System.Reactive.Linq
     }
 }
 
-#endif
-
 #pragma warning restore 1591
 

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

@@ -7,7 +7,7 @@ using System.Reactive.Disposables;
 namespace System.Reactive
 {
     /// <summary>
-    /// Class to create an <see cref="IObservable{T}"/> instance from a delegate-based implementation of the Subscribe method.
+    /// Class to create an <see cref="IObservable{T}"/> instance from a delegate-based implementation of the <see cref="IObservable{T}.Subscribe(IObserver{T})"/> method.
     /// </summary>
     /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
     public sealed class AnonymousObservable<T> : ObservableBase<T>
@@ -17,8 +17,8 @@ namespace System.Reactive
         /// <summary>
         /// Creates an observable sequence object from the specified subscription function.
         /// </summary>
-        /// <param name="subscribe">Subscribe method implementation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="subscribe"/> is null.</exception>
+        /// <param name="subscribe"><see cref="IObservable{T}.Subscribe(IObserver{T})"/> method implementation.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="subscribe"/> is <c>null</c>.</exception>
         public AnonymousObservable(Func<IObserver<T>, IDisposable> subscribe)
         {
             if (subscribe == null)

+ 23 - 35
Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs

@@ -15,12 +15,12 @@ namespace System.Reactive
         private readonly Action _onCompleted;
 
         /// <summary>
-        /// Creates an observer from the specified OnNext, OnError, and OnCompleted actions.
+        /// Creates an observer from the specified <see cref="IObserver{T}.OnNext(T)"/>, <see cref="IObserver{T}.OnError(Exception)"/>, and <see cref="IObserver{T}.OnCompleted()"/> actions.
         /// </summary>
-        /// <param name="onNext">Observer's OnNext action implementation.</param>
-        /// <param name="onError">Observer's OnError action implementation.</param>
-        /// <param name="onCompleted">Observer's OnCompleted action implementation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is null.</exception>
+        /// <param name="onNext">Observer's <see cref="IObserver{T}.OnNext(T)"/> action implementation.</param>
+        /// <param name="onError">Observer's <see cref="IObserver{T}.OnError(Exception)"/> action implementation.</param>
+        /// <param name="onCompleted">Observer's <see cref="IObserver{T}.OnCompleted()"/> action implementation.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is <c>null</c>.</exception>
         public AnonymousObserver(Action<T> onNext, Action<Exception> onError, Action onCompleted)
         {
             if (onNext == null)
@@ -36,66 +36,54 @@ namespace System.Reactive
         }
 
         /// <summary>
-        /// Creates an observer from the specified OnNext action.
+        /// Creates an observer from the specified <see cref="IObserver{T}.OnNext(T)"/> action.
         /// </summary>
-        /// <param name="onNext">Observer's OnNext action implementation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> is null.</exception>
+        /// <param name="onNext">Observer's <see cref="IObserver{T}.OnNext(T)"/> action implementation.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> is <c>null</c>.</exception>
         public AnonymousObserver(Action<T> onNext)
             : this(onNext, Stubs.Throw, Stubs.Nop)
         {
         }
 
         /// <summary>
-        /// Creates an observer from the specified OnNext and OnError actions.
+        /// Creates an observer from the specified <see cref="IObserver{T}.OnNext(T)"/> and <see cref="IObserver{T}.OnError(Exception)"/> actions.
         /// </summary>
-        /// <param name="onNext">Observer's OnNext action implementation.</param>
-        /// <param name="onError">Observer's OnError action implementation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> or <paramref name="onError"/> is null.</exception>
+        /// <param name="onNext">Observer's <see cref="IObserver{T}.OnNext(T)"/> action implementation.</param>
+        /// <param name="onError">Observer's <see cref="IObserver{T}.OnError(Exception)"/> action implementation.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> or <paramref name="onError"/> is <c>null</c>.</exception>
         public AnonymousObserver(Action<T> onNext, Action<Exception> onError)
             : this(onNext, onError, Stubs.Nop)
         {
         }
 
         /// <summary>
-        /// Creates an observer from the specified OnNext and OnCompleted actions.
+        /// Creates an observer from the specified <see cref="IObserver{T}.OnNext(T)"/> and <see cref="IObserver{T}.OnCompleted()"/> actions.
         /// </summary>
-        /// <param name="onNext">Observer's OnNext action implementation.</param>
-        /// <param name="onCompleted">Observer's OnCompleted action implementation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> or <paramref name="onCompleted"/> is null.</exception>
+        /// <param name="onNext">Observer's <see cref="IObserver{T}.OnNext(T)"/> action implementation.</param>
+        /// <param name="onCompleted">Observer's <see cref="IObserver{T}.OnCompleted()"/> action implementation.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="onNext"/> or <paramref name="onCompleted"/> is <c>null</c>.</exception>
         public AnonymousObserver(Action<T> onNext, Action onCompleted)
             : this(onNext, Stubs.Throw, onCompleted)
         {
         }
 
         /// <summary>
-        /// Calls the onNext action.
+        /// Calls the action implementing <see cref="IObserver{T}.OnNext(T)"/>.
         /// </summary>
         /// <param name="value">Next element in the sequence.</param>
-        protected override void OnNextCore(T value)
-        {
-            _onNext(value);
-        }
+        protected override void OnNextCore(T value) => _onNext(value);
 
         /// <summary>
-        /// Calls the onError action.
+        /// Calls the action implementing <see cref="IObserver{T}.OnError(Exception)"/>.
         /// </summary>
         /// <param name="error">The error that has occurred.</param>
-        protected override void OnErrorCore(Exception error)
-        {
-            _onError(error);
-        }
+        protected override void OnErrorCore(Exception error) => _onError(error);
 
         /// <summary>
-        /// Calls the onCompleted action.
+        /// Calls the action implementing <see cref="IObserver{T}.OnCompleted()"/>.
         /// </summary>
-        protected override void OnCompletedCore()
-        {
-            _onCompleted();
-        }
+        protected override void OnCompletedCore() => _onCompleted();
 
-        internal IObserver<T> MakeSafe(IDisposable disposable)
-        {
-            return new AnonymousSafeObserver<T>(_onNext, _onError, _onCompleted, disposable);
-        }
+        internal IObserver<T> MakeSafe(IDisposable disposable) => new AnonymousSafeObserver<T>(_onNext, _onError, _onCompleted, disposable);
     }
 }

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

@@ -18,7 +18,7 @@ namespace System.Reactive
     /// that accept delegates for the On* handlers. By doing the fusion, we make the call stack depth shorter which
     /// helps debugging and some performance.
     /// </summary>
-    class AnonymousSafeObserver<T> : IObserver<T>
+    internal sealed class AnonymousSafeObserver<T> : IObserver<T>
     {
         private readonly Action<T> _onNext;
         private readonly Action<Exception> _onError;

+ 0 - 10
Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs

@@ -3,10 +3,7 @@
 // See the LICENSE file in the project root for more information. 
 
 using System.Reactive.Disposables;
-
-#if !NO_WEAKTABLE
 using System.Runtime.CompilerServices;
-#endif
 
 namespace System.Reactive.Concurrency
 {
@@ -39,7 +36,6 @@ namespace System.Reactive.Concurrency
             };
         }
 
-#if !NO_WEAKTABLE
         public CatchScheduler(IScheduler scheduler, Func<TException, bool> handler, ConditionalWeakTable<IScheduler, IScheduler> cache)
             : base(scheduler, cache)
         {
@@ -50,12 +46,6 @@ namespace System.Reactive.Concurrency
         {
             return new CatchScheduler<TException>(scheduler, _handler, cache);
         }
-#else
-        protected override SchedulerWrapper Clone(IScheduler scheduler)
-        {
-            return new CatchScheduler<TException>(scheduler, _handler);
-        }
-#endif
 
         protected override bool TryGetService(IServiceProvider provider, Type serviceType, out object service)
         {

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

@@ -28,7 +28,6 @@ namespace System.Reactive.Concurrency
             get { return s_instance.Value; }
         }
 
-#if !NO_TLS
         [ThreadStatic]
         static SchedulerQueue<TimeSpan> s_threadLocalQueue;
 
@@ -55,49 +54,6 @@ namespace System.Reactive.Concurrency
                 return s_clock.Elapsed;
             }
         }
-#else
-        private static readonly System.Collections.Generic.Dictionary<int, SchedulerQueue<TimeSpan>> s_queues = new System.Collections.Generic.Dictionary<int, SchedulerQueue<TimeSpan>>();
-        
-        private static readonly System.Collections.Generic.Dictionary<int, IStopwatch> s_clocks = new System.Collections.Generic.Dictionary<int, IStopwatch>();
-
-        private static SchedulerQueue<TimeSpan> GetQueue()
-        {
-            lock (s_queues)
-            { 
-                var item = default(SchedulerQueue<TimeSpan>);
-                if (s_queues.TryGetValue(Thread.CurrentThread.ManagedThreadId, out item))
-                    return item;
-
-                return null;	
-            }
-        }
-
-        private static void SetQueue(SchedulerQueue<TimeSpan> newQueue)
-        {
-            lock (s_queues)
-            {
-                if (newQueue == null)
-                    s_queues.Remove(Thread.CurrentThread.ManagedThreadId);
-                else
-                    s_queues[Thread.CurrentThread.ManagedThreadId] = newQueue;
-            }
-        }
-
-        private static TimeSpan Time
-        {
-            get
-            {
-                lock (s_clocks)
-                {
-                    var clock = default(IStopwatch);
-                    if (!s_clocks.TryGetValue(Thread.CurrentThread.ManagedThreadId, out clock))
-                        s_clocks[Thread.CurrentThread.ManagedThreadId] = clock = ConcurrencyAbstractionLayer.Current.StartStopwatch();
-
-                    return clock.Elapsed;
-                }
-            }
-        }
-#endif
 
         /// <summary>
         /// Gets a value that indicates whether the caller must call a Schedule method.

+ 0 - 10
Rx.NET/Source/src/System.Reactive/Concurrency/DisableOptimizationsScheduler.cs

@@ -3,10 +3,7 @@
 // See the LICENSE file in the project root for more information. 
 
 using System.Linq;
-
-#if !NO_WEAKTABLE
 using System.Runtime.CompilerServices;
-#endif
 
 namespace System.Reactive.Concurrency
 {
@@ -26,7 +23,6 @@ namespace System.Reactive.Concurrency
             _optimizationInterfaces = optimizationInterfaces;
         }
 
-#if !NO_WEAKTABLE
         public DisableOptimizationsScheduler(IScheduler scheduler, Type[] optimizationInterfaces, ConditionalWeakTable<IScheduler, IScheduler> cache)
             : base(scheduler, cache)
         {
@@ -37,12 +33,6 @@ namespace System.Reactive.Concurrency
         {
             return new DisableOptimizationsScheduler(scheduler, _optimizationInterfaces, cache);
         }
-#else
-        protected override SchedulerWrapper Clone(IScheduler scheduler)
-        {
-            return new DisableOptimizationsScheduler(scheduler, _optimizationInterfaces);
-        }
-#endif
 
         protected override bool TryGetService(IServiceProvider provider, Type serviceType, out object service)
         {

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

@@ -45,11 +45,7 @@ namespace System.Reactive.Concurrency
         /// Semaphore to count requests to re-evaluate the queue, from either Schedule requests or when a timer
         /// expires and moves on to the next item in the queue.
         /// </summary>
-#if !NO_CDS
         private readonly SemaphoreSlim _evt;
-#else
-        private readonly Semaphore _evt;
-#endif
 
         /// <summary>
         /// Queue holding work items. Protected by the gate.
@@ -109,11 +105,7 @@ namespace System.Reactive.Concurrency
 
             _gate = new object();
 
-#if !NO_CDS
             _evt = new SemaphoreSlim(0);
-#else
-            _evt = new Semaphore(0, int.MaxValue);
-#endif
             _queue = new SchedulerQueue<TimeSpan>();
             _readyList = new Queue<ScheduledItem<TimeSpan>>();
 
@@ -281,11 +273,7 @@ namespace System.Reactive.Concurrency
         {
             while (true)
             {
-#if !NO_CDS
                 _evt.Wait();
-#else
-                _evt.WaitOne();
-#endif
 
                 var ready = default(ScheduledItem<TimeSpan>[]);
 
@@ -295,11 +283,7 @@ namespace System.Reactive.Concurrency
                     // Bug fix that ensures the number of calls to Release never greatly exceeds the number of calls to Wait.
                     // See work item #37: https://rx.codeplex.com/workitem/37
                     //
-#if !NO_CDS
                     while (_evt.CurrentCount > 0) _evt.Wait();
-#else
-                    while (_evt.WaitOne(TimeSpan.Zero)) { }
-#endif
 
                     //
                     // The event could have been set by a call to Dispose. This takes priority over anything else. We quit the

+ 3 - 10
Rx.NET/Source/src/System.Reactive/Concurrency/ScheduledItem.cs

@@ -15,7 +15,6 @@ namespace System.Reactive.Concurrency
         where TAbsolute : IComparable<TAbsolute>
     {
         private readonly SingleAssignmentDisposable _disposable = new SingleAssignmentDisposable();
-        private readonly TAbsolute _dueTime;
         private readonly IComparer<TAbsolute> _comparer;
 
         /// <summary>
@@ -29,17 +28,14 @@ namespace System.Reactive.Concurrency
             if (comparer == null)
                 throw new ArgumentNullException(nameof(comparer));
 
-            _dueTime = dueTime;
+            DueTime = dueTime;
             _comparer = comparer;
         }
 
         /// <summary>
         /// Gets the absolute time at which the item is due for invocation.
         /// </summary>
-        public TAbsolute DueTime
-        {
-            get { return _dueTime; }
-        }
+        public TAbsolute DueTime { get; }
 
         /// <summary>
         /// Invokes the work item.
@@ -181,10 +177,7 @@ namespace System.Reactive.Concurrency
         /// <summary>
         /// Gets whether the work item has received a cancellation request.
         /// </summary>
-        public bool IsCanceled
-        {
-            get { return _disposable.IsDisposed; }
-        }
+        public bool IsCanceled => _disposable.IsDisposed;
     }
 
     /// <summary>

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

@@ -117,7 +117,6 @@ namespace System.Reactive.Concurrency
             }
         }
 
-#if !NO_TPL
         private static Lazy<IScheduler> s_taskPool = new Lazy<IScheduler>(() => Initialize("TaskPool"));
 
         /// <summary>
@@ -131,7 +130,6 @@ namespace System.Reactive.Concurrency
                 return s_taskPool.Value;
             }
         }
-#endif
 
         private static IScheduler Initialize(string name)
         {

+ 7 - 49
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs

@@ -2,23 +2,25 @@
 // 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. 
 
-#if !NO_WEAKTABLE
 using System.Runtime.CompilerServices;
-#endif
 
 namespace System.Reactive.Concurrency
 {
     internal abstract class SchedulerWrapper : IScheduler, IServiceProvider
     {
         protected readonly IScheduler _scheduler;
+        private readonly ConditionalWeakTable<IScheduler, IScheduler> _cache;
 
         public SchedulerWrapper(IScheduler scheduler)
         {
             _scheduler = scheduler;
-
-#if !NO_WEAKTABLE
             _cache = new ConditionalWeakTable<IScheduler, IScheduler>();
-#endif
+        }
+
+        public SchedulerWrapper(IScheduler scheduler, ConditionalWeakTable<IScheduler, IScheduler> cache)
+        {
+            _scheduler = scheduler;
+            _cache = cache;
         }
 
         public DateTimeOffset Now
@@ -55,56 +57,12 @@ namespace System.Reactive.Concurrency
             return (self, state) => action(GetRecursiveWrapper(self), state);
         }
 
-#if !NO_WEAKTABLE
-        private readonly ConditionalWeakTable<IScheduler, IScheduler> _cache;
-
-        public SchedulerWrapper(IScheduler scheduler, ConditionalWeakTable<IScheduler, IScheduler> cache)
-        {
-            _scheduler = scheduler;
-            _cache = cache;
-        }
-
         protected IScheduler GetRecursiveWrapper(IScheduler scheduler)
         {
             return _cache.GetValue(scheduler, s => Clone(s, _cache));
         }
 
         protected abstract SchedulerWrapper Clone(IScheduler scheduler, ConditionalWeakTable<IScheduler, IScheduler> cache);
-#else
-            private readonly object _gate = new object();
-            private IScheduler _recursiveOriginal;
-            private IScheduler _recursiveWrapper;
-
-            protected IScheduler GetRecursiveWrapper(IScheduler scheduler)
-            {
-                var recursiveWrapper = default(IScheduler);
-
-                lock (_gate)
-                {
-                    //
-                    // Chances are the recursive scheduler will remain the same. In practice, this
-                    // single-shot caching scheme works out quite well. Notice we propagate our
-                    // mini-cache to recursive raw scheduler wrappers too.
-                    //
-                    if (!object.ReferenceEquals(scheduler, _recursiveOriginal))
-                    {
-                        _recursiveOriginal = scheduler;
-
-                        var wrapper = Clone(scheduler);
-                        wrapper._recursiveOriginal = scheduler;
-                        wrapper._recursiveWrapper = wrapper;
-
-                        _recursiveWrapper = wrapper;
-                    }
-
-                    recursiveWrapper = _recursiveWrapper;
-                }
-
-                return recursiveWrapper;
-            }
-
-            protected abstract SchedulerWrapper Clone(IScheduler scheduler);
-#endif
 
         public object GetService(Type serviceType)
         {

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/TaskHelpers.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. 
 
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
 
@@ -30,4 +29,3 @@ namespace System.Reactive.Concurrency
         }
     }
 }
-#endif

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/TaskPoolScheduler.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. 
 
-#if !NO_TPL
 using System.Reactive.Disposables;
 using System.Threading;
 using System.Threading.Tasks;
@@ -205,4 +204,3 @@ namespace System.Reactive.Concurrency
         }
     }
 }
-#endif

+ 1 - 4
Rx.NET/Source/src/System.Reactive/Disposables/AnonymousDisposable.cs

@@ -27,10 +27,7 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _dispose == null; }
-        }
+        public bool IsDisposed => _dispose == null;
 
         /// <summary>
         /// Calls the disposal action if and only if the current instance hasn't been disposed yet.

+ 1 - 4
Rx.NET/Source/src/System.Reactive/Disposables/BooleanDisposable.cs

@@ -31,10 +31,7 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _isDisposed; }
-        }
+        public bool IsDisposed => _isDisposed;
 
         /// <summary>
         /// Sets the status to disposed, which can be observer through the <see cref="IsDisposed"/> property.

+ 5 - 16
Rx.NET/Source/src/System.Reactive/Disposables/CancellationDisposable.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. 
 
-#if !NO_TPL
 using System.Threading;
 
 namespace System.Reactive.Disposables
@@ -18,7 +17,7 @@ namespace System.Reactive.Disposables
         /// Initializes a new instance of the <see cref="CancellationDisposable"/> class that uses an existing <seealso cref="CancellationTokenSource"/>.
         /// </summary>
         /// <param name="cts"><seealso cref="CancellationTokenSource"/> used for cancellation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="cts"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="cts"/> is <c>null</c>.</exception>
         public CancellationDisposable(CancellationTokenSource cts)
         {
             if (cts == null)
@@ -36,28 +35,18 @@ namespace System.Reactive.Disposables
         }
 
         /// <summary>
-        /// Gets the <see cref="CancellationToken"/> used by this CancellationDisposable.
+        /// Gets the <see cref="CancellationToken"/> used by this <see cref="CancellationDisposable"/>.
         /// </summary>
-        public CancellationToken Token
-        {
-            get { return _cts.Token; }
-        }
+        public CancellationToken Token => _cts.Token;
 
         /// <summary>
         /// Cancels the underlying <seealso cref="CancellationTokenSource"/>.
         /// </summary>
-        public void Dispose()
-        {
-            _cts.Cancel();
-        }
+        public void Dispose() => _cts.Cancel();
 
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _cts.IsCancellationRequested; }
-        }
+        public bool IsDisposed => _cts.IsCancellationRequested;
     }
 }
-#endif

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

@@ -2,6 +2,7 @@
 // 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;
 using System.Collections.Generic;
 using System.Linq;
 
@@ -45,8 +46,8 @@ namespace System.Reactive.Disposables
         /// Initializes a new instance of the <see cref="CompositeDisposable"/> class from a group of disposables.
         /// </summary>
         /// <param name="disposables">Disposables that will be disposed together.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="disposables"/> is null.</exception>
-        /// <exception cref="ArgumentException">Any of the disposables in the <paramref name="disposables"/> collection is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="disposables"/> is <c>null</c>.</exception>
+        /// <exception cref="ArgumentException">Any of the disposables in the <paramref name="disposables"/> collection is <c>null</c>.</exception>
         public CompositeDisposable(params IDisposable[] disposables)
             : this((IEnumerable<IDisposable>)disposables)
         {
@@ -56,40 +57,34 @@ namespace System.Reactive.Disposables
         /// Initializes a new instance of the <see cref="CompositeDisposable"/> class from a group of disposables.
         /// </summary>
         /// <param name="disposables">Disposables that will be disposed together.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="disposables"/> is null.</exception>
-        /// <exception cref="ArgumentException">Any of the disposables in the <paramref name="disposables"/> collection is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="disposables"/> is <c>null</c>.</exception>
+        /// <exception cref="ArgumentException">Any of the disposables in the <paramref name="disposables"/> collection is <c>null</c>.</exception>
         public CompositeDisposable(IEnumerable<IDisposable> disposables)
         {
             if (disposables == null)
                 throw new ArgumentNullException(nameof(disposables));
 
             _disposables = new List<IDisposable>(disposables);
-            
+
             //
             // Doing this on the list to avoid duplicate enumeration of disposables.
             //
             if (_disposables.Contains(null))
                 throw new ArgumentException(Strings_Core.DISPOSABLES_CANT_CONTAIN_NULL, nameof(disposables));
-            
+
             _count = _disposables.Count;
         }
 
         /// <summary>
-        /// Gets the number of disposables contained in the CompositeDisposable.
+        /// Gets the number of disposables contained in the <see cref="CompositeDisposable"/>.
         /// </summary>
-        public int Count
-        {
-            get
-            {
-                return _count;
-            }
-        }
+        public int Count => _count;
 
         /// <summary>
-        /// Adds a disposable to the CompositeDisposable or disposes the disposable if the CompositeDisposable is disposed.
+        /// Adds a disposable to the <see cref="CompositeDisposable"/> or disposes the disposable if the <see cref="CompositeDisposable"/> is disposed.
         /// </summary>
         /// <param name="item">Disposable to add.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="item"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="item"/> is <c>null</c>.</exception>
         public void Add(IDisposable item)
         {
             if (item == null)
@@ -105,16 +100,19 @@ namespace System.Reactive.Disposables
                     _count++;
                 }
             }
+
             if (shouldDispose)
+            {
                 item.Dispose();
+            }
         }
 
         /// <summary>
-        /// Removes and disposes the first occurrence of a disposable from the CompositeDisposable.
+        /// Removes and disposes the first occurrence of a disposable from the <see cref="CompositeDisposable"/>.
         /// </summary>
         /// <param name="item">Disposable to remove.</param>
         /// <returns>true if found; false otherwise.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="item"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="item"/> is <c>null</c>.</exception>
         public bool Remove(IDisposable item)
         {
             if (item == null)
@@ -146,15 +144,21 @@ namespace System.Reactive.Disposables
                             _disposables = new List<IDisposable>(_disposables.Capacity / 2);
 
                             foreach (var d in old)
+                            {
                                 if (d != null)
+                                {
                                     _disposables.Add(d);
+                                }
+                            }
                         }
                     }
                 }
             }
 
             if (shouldDispose)
+            {
                 item.Dispose();
+            }
 
             return shouldDispose;
         }
@@ -179,13 +183,14 @@ namespace System.Reactive.Disposables
             if (currentDisposables != null)
             {
                 foreach (var d in currentDisposables)
-                    if (d != null)
-                        d.Dispose();
+                {
+                    d?.Dispose();
+                }
             }
         }
 
         /// <summary>
-        /// Removes and disposes all disposables from the CompositeDisposable, but does not dispose the CompositeDisposable.
+        /// Removes and disposes all disposables from the <see cref="CompositeDisposable"/>, but does not dispose the <see cref="CompositeDisposable"/>.
         /// </summary>
         public void Clear()
         {
@@ -198,16 +203,17 @@ namespace System.Reactive.Disposables
             }
 
             foreach (var d in currentDisposables)
-                if (d != null)
-                    d.Dispose();
+            {
+                d?.Dispose();
+            }
         }
 
         /// <summary>
-        /// Determines whether the CompositeDisposable contains a specific disposable.
+        /// Determines whether the <see cref="CompositeDisposable"/> contains a specific disposable.
         /// </summary>
         /// <param name="item">Disposable to search for.</param>
         /// <returns>true if the disposable was found; otherwise, false.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="item"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="item"/> is <c>null</c>.</exception>
         public bool Contains(IDisposable item)
         {
             if (item == null)
@@ -220,11 +226,11 @@ namespace System.Reactive.Disposables
         }
 
         /// <summary>
-        /// Copies the disposables contained in the CompositeDisposable to an array, starting at a particular array index.
+        /// Copies the disposables contained in the <see cref="CompositeDisposable"/> to an array, starting at a particular array index.
         /// </summary>
         /// <param name="array">Array to copy the contained disposables to.</param>
         /// <param name="arrayIndex">Target index at which to copy the first disposable of the group.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="array"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="array"/> is <c>null</c>.</exception>
         /// <exception cref="ArgumentOutOfRangeException"><paramref name="arrayIndex"/> is less than zero. -or - <paramref name="arrayIndex"/> is larger than or equal to the array length.</exception>
         public void CopyTo(IDisposable[] array, int arrayIndex)
         {
@@ -242,13 +248,10 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Always returns false.
         /// </summary>
-        public bool IsReadOnly
-        {
-            get { return false; }
-        }
+        public bool IsReadOnly => false;
 
         /// <summary>
-        /// Returns an enumerator that iterates through the CompositeDisposable.
+        /// Returns an enumerator that iterates through the <see cref="CompositeDisposable"/>.
         /// </summary>
         /// <returns>An enumerator to iterate over the disposables.</returns>
         public IEnumerator<IDisposable> GetEnumerator()
@@ -264,20 +267,14 @@ namespace System.Reactive.Disposables
         }
 
         /// <summary>
-        /// Returns an enumerator that iterates through the CompositeDisposable.
+        /// Returns an enumerator that iterates through the <see cref="CompositeDisposable"/>.
         /// </summary>
         /// <returns>An enumerator to iterate over the disposables.</returns>
-        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
-        {
-            return GetEnumerator();
-        }
+        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
 
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _disposed; }
-        }
+        public bool IsDisposed => _disposed;
     }
 }

+ 4 - 11
Rx.NET/Source/src/System.Reactive/Disposables/ContextDisposable.cs

@@ -12,7 +12,6 @@ namespace System.Reactive.Disposables
     /// </summary>
     public sealed class ContextDisposable : ICancelable
     {
-        private readonly SynchronizationContext _context;
         private volatile IDisposable _disposable;
 
         /// <summary>
@@ -28,25 +27,19 @@ namespace System.Reactive.Disposables
             if (disposable == null)
                 throw new ArgumentNullException(nameof(disposable));
 
-            _context = context;
+            Context = context;
             _disposable = disposable;
         }
 
         /// <summary>
         /// Gets the provided <see cref="SynchronizationContext"/>.
         /// </summary>
-        public SynchronizationContext Context
-        {
-            get { return _context; }
-        }
+        public SynchronizationContext Context { get; }
 
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _disposable == BooleanDisposable.True; }
-        }
+        public bool IsDisposed => _disposable == BooleanDisposable.True;
 
         /// <summary>
         /// Disposes the underlying disposable on the provided <see cref="SynchronizationContext"/>.
@@ -57,7 +50,7 @@ namespace System.Reactive.Disposables
 
             if (disposable != BooleanDisposable.True)
             {
-                _context.PostWithStartComplete(d => d.Dispose(), disposable);
+                Context.PostWithStartComplete(d => d.Dispose(), disposable);
             }
         }
     }

+ 3 - 6
Rx.NET/Source/src/System.Reactive/Disposables/Disposable.cs

@@ -5,24 +5,21 @@
 namespace System.Reactive.Disposables
 {
     /// <summary>
-    /// Provides a set of static methods for creating Disposables.
+    /// Provides a set of static methods for creating <see cref="IDisposable"/> objects.
     /// </summary>
     public static class Disposable
     {
         /// <summary>
         /// Gets the disposable that does nothing when disposed.
         /// </summary>
-        public static IDisposable Empty
-        {
-            get { return DefaultDisposable.Instance; }
-        }
+        public static IDisposable Empty => DefaultDisposable.Instance;
 
         /// <summary>
         /// Creates a disposable object that invokes the specified action when disposed.
         /// </summary>
         /// <param name="dispose">Action to run during the first call to <see cref="IDisposable.Dispose"/>. The action is guaranteed to be run at most once.</param>
         /// <returns>The disposable object that runs the given action upon disposal.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="dispose"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="dispose"/> is <c>null</c>.</exception>
         public static IDisposable Create(Action dispose)
         {
             if (dispose == null)

+ 9 - 1
Rx.NET/Source/src/System.Reactive/Disposables/MultipleAssignmentDisposable.cs

@@ -37,17 +37,19 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined.
         /// </summary>
-        /// <remarks>If the MutableDisposable has already been disposed, assignment to this property causes immediate disposal of the given disposable object.</remarks>
+        /// <remarks>If the <see cref="MultipleAssignmentDisposable"/> has already been disposed, assignment to this property causes immediate disposal of the given disposable object.</remarks>
         public IDisposable Disposable
         {
             get
             {
                 var a = Volatile.Read(ref _current);
+
                 // Don't leak the DISPOSED sentinel
                 if (a == BooleanDisposable.True)
                 {
                     a = DefaultDisposable.Instance;
                 }
+
                 return a;
             }
 
@@ -55,6 +57,7 @@ namespace System.Reactive.Disposables
             {
                 // Let's read the current value atomically (also prevents reordering).
                 var old = Volatile.Read(ref _current);
+
                 for (;;)
                 {
                     // If it is the disposed instance, dispose the value.
@@ -63,13 +66,16 @@ namespace System.Reactive.Disposables
                         value?.Dispose();
                         return;
                     }
+
                     // Atomically swap in the new value and get back the old.
                     var b = Interlocked.CompareExchange(ref _current, value, old);
+
                     // If the old and new are the same, the swap was successful and we can quit
                     if (old == b)
                     {
                         return;
                     }
+
                     // Otherwise, make the old reference the current and retry.
                     old = b;
                 }
@@ -83,11 +89,13 @@ namespace System.Reactive.Disposables
         {
             // Read the current atomically.
             var a = Volatile.Read(ref _current);
+
             // If it is the disposed instance, don't bother further.
             if (a != BooleanDisposable.True)
             {
                 // Atomically swap in the disposed instance.
                 a = Interlocked.Exchange(ref _current, BooleanDisposable.True);
+
                 // It is possible there was a concurrent Dispose call so don't need to call Dispose()
                 // on DISPOSED
                 if (a != BooleanDisposable.True)

+ 5 - 12
Rx.NET/Source/src/System.Reactive/Disposables/RefCountDisposable.cs

@@ -46,10 +46,7 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _disposable == null; }
-        }
+        public bool IsDisposed => _disposable == null;
 
         /// <summary>
         /// Returns a dependent disposable that when disposed decreases the refcount on the underlying disposable.
@@ -99,8 +96,7 @@ namespace System.Reactive.Disposables
                 }
             }
 
-            if (disposable != null)
-                disposable.Dispose();
+            disposable?.Dispose();
         }
 
         private void Release()
@@ -125,11 +121,10 @@ namespace System.Reactive.Disposables
                 }
             }
 
-            if (disposable != null)
-                disposable.Dispose();
+            disposable?.Dispose();
         }
 
-        sealed class InnerDisposable : IDisposable
+        private sealed class InnerDisposable : IDisposable
         {
             private RefCountDisposable _parent;
 
@@ -140,9 +135,7 @@ namespace System.Reactive.Disposables
 
             public void Dispose()
             {
-                var parent = Interlocked.Exchange(ref _parent, null);
-                if (parent != null)
-                    parent.Release();
+                Interlocked.Exchange(ref _parent, null)?.Release();
             }
         }
     }

+ 6 - 14
Rx.NET/Source/src/System.Reactive/Disposables/ScheduledDisposable.cs

@@ -12,7 +12,6 @@ namespace System.Reactive.Disposables
     /// </summary>
     public sealed class ScheduledDisposable : ICancelable
     {
-        private readonly IScheduler _scheduler;
         private volatile IDisposable _disposable;
 
         /// <summary>
@@ -28,17 +27,14 @@ namespace System.Reactive.Disposables
             if (disposable == null)
                 throw new ArgumentNullException(nameof(disposable));
 
-            _scheduler = scheduler;
+            Scheduler = scheduler;
             _disposable = disposable;
         }
 
         /// <summary>
         /// Gets the scheduler where the disposable resource will be disposed on.
         /// </summary>
-        public IScheduler Scheduler
-        {
-            get { return _scheduler; }
-        }
+        public IScheduler Scheduler { get; }
 
         /// <summary>
         /// Gets the underlying disposable. After disposal, the result is undefined.
@@ -50,7 +46,9 @@ namespace System.Reactive.Disposables
                 var current = _disposable;
 
                 if (current == BooleanDisposable.True)
+                {
                     return DefaultDisposable.Instance; // Don't leak the sentinel value.
+                }
 
                 return current;
             }
@@ -59,18 +57,12 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Gets a value that indicates whether the object is disposed.
         /// </summary>
-        public bool IsDisposed
-        {
-            get { return _disposable == BooleanDisposable.True; }
-        }
+        public bool IsDisposed => _disposable == BooleanDisposable.True;
 
         /// <summary>
         /// Disposes the wrapped disposable on the provided scheduler.
         /// </summary>
-        public void Dispose()
-        {
-            Scheduler.Schedule(DisposeInner);
-        }
+        public void Dispose() => Scheduler.Schedule(DisposeInner);
 
         private void DisposeInner()
         {

+ 8 - 6
Rx.NET/Source/src/System.Reactive/Disposables/SerialDisposable.cs

@@ -58,10 +58,13 @@ namespace System.Reactive.Disposables
                         _current = value;
                     }
                 }
-                if (old != null)
-                    old.Dispose();
-                if (shouldDispose && value != null)
-                    value.Dispose();
+
+                old?.Dispose();
+
+                if (shouldDispose)
+                {
+                    value?.Dispose();
+                }
             }
         }
 
@@ -82,8 +85,7 @@ namespace System.Reactive.Disposables
                 }
             }
 
-            if (old != null)
-                old.Dispose();
+            old?.Dispose();
         }
     }
 }

+ 5 - 6
Rx.NET/Source/src/System.Reactive/Disposables/SingleAssignmentDisposable.cs

@@ -38,7 +38,7 @@ namespace System.Reactive.Disposables
         /// <summary>
         /// Gets or sets the underlying disposable. After disposal, the result of getting this property is undefined.
         /// </summary>
-        /// <exception cref="InvalidOperationException">Thrown if the SingleAssignmentDisposable has already been assigned to.</exception>
+        /// <exception cref="InvalidOperationException">Thrown if the <see cref="SingleAssignmentDisposable"/> has already been assigned to.</exception>
         public IDisposable Disposable
         {
             get
@@ -46,7 +46,9 @@ namespace System.Reactive.Disposables
                 var current = _current;
 
                 if (current == BooleanDisposable.True)
+                {
                     return DefaultDisposable.Instance; // Don't leak the sentinel value.
+                }
 
                 return current;
             }
@@ -60,8 +62,7 @@ namespace System.Reactive.Disposables
                 if (old != BooleanDisposable.True)
                     throw new InvalidOperationException(Strings_Core.DISPOSABLE_ALREADY_ASSIGNED);
 
-                if (value != null)
-                    value.Dispose();
+                value?.Dispose();
             }
         }
 
@@ -70,9 +71,7 @@ namespace System.Reactive.Disposables
         /// </summary>
         public void Dispose()
         {
-            var old = Interlocked.Exchange(ref _current, BooleanDisposable.True);
-            if (old != null)
-                old.Dispose();
+            Interlocked.Exchange(ref _current, BooleanDisposable.True)?.Dispose();
         }
     }
 }

+ 6 - 27
Rx.NET/Source/src/System.Reactive/Disposables/StableCompositeDisposable.cs

@@ -67,7 +67,7 @@ namespace System.Reactive.Disposables
             get;
         }
 
-        class Binary : StableCompositeDisposable
+        private sealed class Binary : StableCompositeDisposable
         {
             private volatile IDisposable _disposable1;
             private volatile IDisposable _disposable2;
@@ -78,31 +78,16 @@ namespace System.Reactive.Disposables
                 _disposable2 = disposable2;
             }
 
-            public override bool IsDisposed
-            {
-                get
-                {
-                    return _disposable1 == null;
-                }
-            }
+            public override bool IsDisposed => _disposable1 == null;
 
             public override void Dispose()
             {
-                var old1 = Interlocked.Exchange(ref _disposable1, null);
-                if (old1 != null)
-                {
-                    old1.Dispose();
-                }
-
-                var old2 = Interlocked.Exchange(ref _disposable2, null);
-                if (old2 != null)
-                {
-                    old2.Dispose();
-                }
+                Interlocked.Exchange(ref _disposable1, null)?.Dispose();
+                Interlocked.Exchange(ref _disposable2, null)?.Dispose();
             }
         }
 
-        class NAry : StableCompositeDisposable
+        private sealed class NAry : StableCompositeDisposable
         {
             private volatile List<IDisposable> _disposables;
 
@@ -122,13 +107,7 @@ namespace System.Reactive.Disposables
                     throw new ArgumentException(Strings_Core.DISPOSABLES_CANT_CONTAIN_NULL, nameof(disposables));
             }
 
-            public override bool IsDisposed
-            {
-                get
-                {
-                    return _disposables == null;
-                }
-            }
+            public override bool IsDisposed => _disposables == null;
 
             public override void Dispose()
             {

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

@@ -7,8 +7,8 @@ namespace System.Reactive.PlatformServices
     /// <summary>
     /// Provides access to the platform enlightenments used by other Rx libraries to improve system performance and
     /// runtime efficiency. While Rx can run without platform enlightenments loaded, it's recommended to deploy the
-    /// System.Reactive.PlatformServices assembly with your application and call <see cref="EnlightenmentProvider.
-    /// EnsureLoaded"/> during application startup to ensure enlightenments are properly loaded.
+    /// System.Reactive.PlatformServices assembly with your application and call <see cref="EnsureLoaded"/> during
+    /// application startup to ensure enlightenments are properly loaded.
     /// </summary>
     public static class EnlightenmentProvider
     {

+ 15 - 24
Rx.NET/Source/src/System.Reactive/EventPattern.cs

@@ -44,23 +44,23 @@ namespace System.Reactive
         /// <summary>
         /// Gets the sender object that raised the event.
         /// </summary>
-        public TSender Sender { get; private set; }
+        public TSender Sender { get; }
 
         /// <summary>
         /// Gets the event data that was generated by the event.
         /// </summary>
-        public TEventArgs EventArgs { get; private set; }
+        public TEventArgs EventArgs { get; }
 
         /// <summary>
         /// Determines whether the current <see cref="EventPattern{TSender, TEventArgs}"/> object represents the same event as a specified <see cref="EventPattern{TSender, TEventArgs}"/> object.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="EventPattern{TSender, TEventArgs}"/> object.</param>
-        /// <returns>true if both <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event; otherwise, <c>false</c>.</returns>
         public bool Equals(EventPattern<TSender, TEventArgs> other)
         {
-            if (object.ReferenceEquals(null, other))
+            if (ReferenceEquals(null, other))
                 return false;
-            if (object.ReferenceEquals(this, other))
+            if (ReferenceEquals(this, other))
                 return true;
 
             return EqualityComparer<TSender>.Default.Equals(Sender, other.Sender) && EqualityComparer<TEventArgs>.Default.Equals(EventArgs, other.EventArgs);
@@ -70,11 +70,8 @@ namespace System.Reactive
         /// Determines whether the specified System.Object is equal to the current <see cref="EventPattern{TSender, TEventArgs}"/>.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="EventPattern{TSender, TEventArgs}"/>.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="EventPattern{TSender, TEventArgs}"/>; otherwise, false.</returns>
-        public override bool Equals(object obj)
-        {
-            return Equals(obj as EventPattern<TSender, TEventArgs>);
-        }
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="EventPattern{TSender, TEventArgs}"/>; otherwise, <c>false</c>.</returns>
+        public override bool Equals(object obj) => Equals(obj as EventPattern<TSender, TEventArgs>);
 
         /// <summary>
         /// Returns the hash code for the current <see cref="EventPattern{TSender, TEventArgs}"/> instance.
@@ -90,23 +87,17 @@ namespace System.Reactive
         /// <summary>
         /// Determines whether two specified <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event.
         /// </summary>
-        /// <param name="first">The first <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or null.</param>
-        /// <param name="second">The second <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or null.</param>
-        /// <returns>true if both <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event; otherwise, false.</returns>
-        public static bool operator ==(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second)
-        {
-            return object.Equals(first, second);
-        }
+        /// <param name="first">The first <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
+        /// <param name="second">The second <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
+        /// <returns><c>true</c> if both <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event; otherwise, <c>false</c>.</returns>
+        public static bool operator ==(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second) => Equals(first, second);
 
         /// <summary>
         /// Determines whether two specified <see cref="EventPattern{TSender, TEventArgs}"/> objects represent a different event.
         /// </summary>
-        /// <param name="first">The first <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or null.</param>
-        /// <param name="second">The second <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or null.</param>
-        /// <returns>true if both <see cref="EventPattern{TSender, TEventArgs}"/> objects don't represent the same event; otherwise, false.</returns>
-        public static bool operator !=(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second)
-        {
-            return !object.Equals(first, second);
-        }
+        /// <param name="first">The first <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
+        /// <param name="second">The second <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
+        /// <returns><c>true</c> if both <see cref="EventPattern{TSender, TEventArgs}"/> objects don't represent the same event; otherwise, <c>false</c>.</returns>
+        public static bool operator !=(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second) => !Equals(first, second);
     }
 }

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

@@ -4,7 +4,7 @@
 
 namespace System.Reactive
 {
-    class EventPatternSource<TEventArgs> : EventPatternSourceBase<object, TEventArgs>, IEventPatternSource<TEventArgs>
+    internal sealed class EventPatternSource<TEventArgs> : EventPatternSourceBase<object, TEventArgs>, IEventPatternSource<TEventArgs>
     {
         public EventPatternSource(IObservable<EventPattern<object, TEventArgs>> source, Action<Action<object, TEventArgs>, /*object,*/ EventPattern<object, TEventArgs>> invokeHandler)
             : base(source, invokeHandler)

+ 17 - 9
Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs

@@ -24,7 +24,7 @@ namespace System.Reactive
         /// </summary>
         /// <param name="source">Source sequence to expose as an event.</param>
         /// <param name="invokeHandler">Delegate used to invoke the event for each element of the sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="invokeHandler"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="invokeHandler"/> is <c>null</c>.</exception>
         protected EventPatternSourceBase(IObservable<EventPattern<TSender, TEventArgs>> source, Action<Action<TSender, TEventArgs>, /*object,*/ EventPattern<TSender, TEventArgs>> invokeHandler)
         {
             if (source == null)
@@ -40,9 +40,9 @@ namespace System.Reactive
         /// <summary>
         /// Adds the specified event handler, causing a subscription to the underlying source.
         /// </summary>
-        /// <param name="handler">Event handler to add. The same delegate should be passed to the Remove operation in order to remove the event handler.</param>
+        /// <param name="handler">Event handler to add. The same delegate should be passed to the <see cref="Remove(Delegate)"/> operation in order to remove the event handler.</param>
         /// <param name="invoke">Invocation delegate to raise the event in the derived class.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="handler"/> or <paramref name="invoke"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="handler"/> or <paramref name="invoke"/> is <c>null</c>.</exception>
         protected void Add(Delegate handler, Action<TSender, TEventArgs> invoke)
         {
             if (handler == null)
@@ -59,9 +59,13 @@ namespace System.Reactive
                 lock (gate)
                 {
                     if (isAdded)
+                    {
                         Remove(handler);
+                    }
                     else
+                    {
                         isDone = true;
+                    }
                 }
             });
 
@@ -71,7 +75,7 @@ namespace System.Reactive
             var d = _source.Subscribe/*Unsafe*/(
                 x => _invokeHandler(invoke, /*this,*/ x),
                 ex => { remove(); ex.Throw(); },
-                () => remove()
+                remove
             );
 
             lock (gate)
@@ -90,17 +94,19 @@ namespace System.Reactive
             {
                 var l = new Stack<IDisposable>();
                 if (!_subscriptions.TryGetValue(handler, out l))
+                {
                     _subscriptions[handler] = l = new Stack<IDisposable>();
+                }
 
                 l.Push(disposable);
             }
         }
 
         /// <summary>
-        /// Removes the specified event handler, causing a disposal of the corresponding subscription to the underlying source that was created during the Add operation.
+        /// Removes the specified event handler, causing a disposal of the corresponding subscription to the underlying source that was created during the <see cref="Add(Delegate, Action{TSender, TEventArgs})"/> operation.
         /// </summary>
-        /// <param name="handler">Event handler to remove. This should be the same delegate as one that was passed to the Add operation.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="handler"/> is null.</exception>
+        /// <param name="handler">Event handler to remove. This should be the same delegate as one that was passed to the <see cref="Add(Delegate, Action{TSender, TEventArgs})"/> operation.</param>
+        /// <exception cref="ArgumentNullException"><paramref name="handler"/> is <c>null</c>.</exception>
         protected void Remove(Delegate handler)
         {
             if (handler == null)
@@ -114,13 +120,15 @@ namespace System.Reactive
                 if (_subscriptions.TryGetValue(handler, out l))
                 {
                     d = l.Pop();
+
                     if (l.Count == 0)
+                    {
                         _subscriptions.Remove(handler);
+                    }
                 }
             }
 
-            if (d != null)
-                d.Dispose();
+            d?.Dispose();
         }
     }
 }

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

@@ -6,7 +6,7 @@ using System.Collections.Generic;
 
 namespace System.Reactive
 {
-    class EventSource<T> : IEventSource<T>
+    internal sealed class EventSource<T> : IEventSource<T>
     {
         private readonly IObservable<T> _source;
         private readonly Dictionary<Delegate, Stack<IDisposable>> _subscriptions;
@@ -32,9 +32,13 @@ namespace System.Reactive
                     lock (gate)
                     {
                         if (isAdded)
+                        {
                             Remove(value);
+                        }
                         else
+                        {
                             isDone = true;
+                        }
                     }
                 });
 
@@ -44,7 +48,7 @@ namespace System.Reactive
                 var d = _source.Subscribe/*Unsafe*/(
                     x => _invokeHandler(value, /*this,*/ x),
                     ex => { remove(); ex.Throw(); },
-                    () => remove()
+                    remove
                 );
 
                 lock (gate)
@@ -69,7 +73,9 @@ namespace System.Reactive
             {
                 var l = new Stack<IDisposable>();
                 if (!_subscriptions.TryGetValue(handler, out l))
+                {
                     _subscriptions[handler] = l = new Stack<IDisposable>();
+                }
 
                 l.Push(disposable);
             }
@@ -85,13 +91,15 @@ namespace System.Reactive
                 if (_subscriptions.TryGetValue(handler, out l))
                 {
                     d = l.Pop();
+
                     if (l.Count == 0)
+                    {
                         _subscriptions.Remove(handler);
+                    }
                 }
             }
 
-            if (d != null)
-                d.Dispose();
+            d?.Dispose();
         }
     }
 }

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

@@ -12,4 +12,4 @@ namespace System.Diagnostics.CodeAnalysis
     }
 }
 
-#endif
+#endif

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

@@ -52,10 +52,8 @@ namespace System.Reactive.PlatformServices
                     case "ThreadPool":
                         return (T)(object)ThreadPoolScheduler.Default;
 #endif
-#if !NO_TPL
                     case "TaskPool":
                         return (T)(object)TaskPoolScheduler.Default;
-#endif
                     case "NewThread":
                         return (T)(object)NewThreadScheduler.Default;
                 }

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

@@ -2,7 +2,7 @@
 // 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. 
 
-#if NO_CDS || NO_PERF
+#if NO_PERF
 using System.Collections.Generic;
 
 namespace System.Reactive

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

@@ -9,7 +9,7 @@ using System.Threading;
 
 namespace System.Reactive
 {
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
     using System.Collections.Concurrent;
     using System.Diagnostics;
 

+ 0 - 46
Rx.NET/Source/src/System.Reactive/Internal/SystemClock.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.Collections;
 using System.Collections.Generic;
 using System.ComponentModel;
 using System.Reactive.Concurrency;
@@ -22,11 +21,7 @@ namespace System.Reactive.PlatformServices
     {
         private static Lazy<ISystemClock> s_serviceSystemClock = new Lazy<ISystemClock>(InitializeSystemClock);
         private static Lazy<INotifySystemClockChanged> s_serviceSystemClockChanged = new Lazy<INotifySystemClockChanged>(InitializeSystemClockChanged);
-#if NO_WEAKREFOFT
-        private static readonly HashSet<WeakReference> s_systemClockChanged = new HashSet<WeakReference>();
-#else
         private static readonly HashSet<WeakReference<LocalScheduler>> s_systemClockChanged = new HashSet<WeakReference<LocalScheduler>>();
-#endif
         private static IDisposable s_systemClockChangedHandlerCollector;
 
         private static int _refCount;
@@ -69,13 +64,8 @@ namespace System.Reactive.PlatformServices
             {
                 foreach (var entry in s_systemClockChanged)
                 {
-#if NO_WEAKREFOFT
-                    var scheduler = entry.Target as LocalScheduler;
-                    if (scheduler != null)
-#else
                     var scheduler = default(LocalScheduler);
                     if (entry.TryGetTarget(out scheduler))
-#endif
                     {
                         scheduler.SystemClockChanged(sender, e);
                     }
@@ -109,11 +99,7 @@ namespace System.Reactive.PlatformServices
             //
             lock (s_systemClockChanged)
             {
-#if NO_WEAKREFOFT
-                s_systemClockChanged.Add(new WeakReference(scheduler, false));
-#else
                 s_systemClockChanged.Add(new WeakReference<LocalScheduler>(scheduler));
-#endif
 
                 if (s_systemClockChanged.Count == 1)
                 {
@@ -137,29 +123,16 @@ namespace System.Reactive.PlatformServices
             //
             lock (s_systemClockChanged)
             {
-#if NO_WEAKREFOFT
-                var remove = default(HashSet<WeakReference>);
-#else
                 var remove = default(HashSet<WeakReference<LocalScheduler>>);
-#endif
 
                 foreach (var handler in s_systemClockChanged)
                 {
-#if NO_WEAKREFOFT
-                    var scheduler = handler.Target as LocalScheduler;
-                    if (scheduler == null)
-#else
                     var scheduler = default(LocalScheduler);
                     if (!handler.TryGetTarget(out scheduler))
-#endif
                     {
                         if (remove == null)
                         {
-#if NO_WEAKREFOFT
-                            remove = new HashSet<WeakReference>();
-#else
                             remove = new HashSet<WeakReference<LocalScheduler>>();
-#endif
                         }
 
                         remove.Add(handler);
@@ -254,23 +227,4 @@ namespace System.Reactive.PlatformServices
         /// </summary>
         public DateTimeOffset NewTime { get; private set; }
     }
-
-#if NO_WEAKREFOFT
-    class WeakReference<T>
-        where T : class
-    {
-        private readonly WeakReference _weakReference;
-
-        public WeakReference(T value)
-        {
-            _weakReference = new WeakReference(value);
-        }
-
-        public bool TryGetTarget(out T value)
-        {
-            value = (T)_weakReference.Target;
-            return value != null;
-        }
-    }
-#endif
 }

+ 0 - 375
Rx.NET/Source/src/System.Reactive/Linq/ExpressionVisitor.cs

@@ -1,375 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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. 
-
-#if NO_EXPRESSIONVISITOR
-
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Reflection;
-using System.Linq.Expressions;
-
-namespace System.Reactive.Linq
-{
-    internal abstract class ExpressionVisitor
-    {
-        internal ExpressionVisitor()
-        {
-        }
-
-        public virtual Expression Visit(Expression exp)
-        {
-            if (exp == null)
-                return exp;
-            switch (exp.NodeType)
-            {
-                case ExpressionType.UnaryPlus:
-                case ExpressionType.Negate:
-                case ExpressionType.NegateChecked:
-                case ExpressionType.Not:
-                case ExpressionType.Convert:
-                case ExpressionType.ConvertChecked:
-                case ExpressionType.ArrayLength:
-                case ExpressionType.Quote:
-                case ExpressionType.TypeAs:
-                    return this.VisitUnary((UnaryExpression)exp);
-                case ExpressionType.Add:
-                case ExpressionType.AddChecked:
-                case ExpressionType.Subtract:
-                case ExpressionType.SubtractChecked:
-                case ExpressionType.Multiply:
-                case ExpressionType.MultiplyChecked:
-                case ExpressionType.Divide:
-                case ExpressionType.Modulo:
-                case ExpressionType.Power:
-                case ExpressionType.And:
-                case ExpressionType.AndAlso:
-                case ExpressionType.Or:
-                case ExpressionType.OrElse:
-                case ExpressionType.LessThan:
-                case ExpressionType.LessThanOrEqual:
-                case ExpressionType.GreaterThan:
-                case ExpressionType.GreaterThanOrEqual:
-                case ExpressionType.Equal:
-                case ExpressionType.NotEqual:
-                case ExpressionType.Coalesce:
-                case ExpressionType.ArrayIndex:
-                case ExpressionType.RightShift:
-                case ExpressionType.LeftShift:
-                case ExpressionType.ExclusiveOr:
-                    return this.VisitBinary((BinaryExpression)exp);
-                case ExpressionType.TypeIs:
-                    return this.VisitTypeIs((TypeBinaryExpression)exp);
-                case ExpressionType.Conditional:
-                    return this.VisitConditional((ConditionalExpression)exp);
-                case ExpressionType.Constant:
-                    return this.VisitConstant((ConstantExpression)exp);
-                case ExpressionType.Parameter:
-                    return this.VisitParameter((ParameterExpression)exp);
-                case ExpressionType.MemberAccess:
-                    return this.VisitMemberAccess((MemberExpression)exp);
-                case ExpressionType.Call:
-                    return this.VisitMethodCall((MethodCallExpression)exp);
-                case ExpressionType.Lambda:
-                    return this.VisitLambda((LambdaExpression)exp);
-                case ExpressionType.New:
-                    return this.VisitNew((NewExpression)exp);
-                case ExpressionType.NewArrayInit:
-                case ExpressionType.NewArrayBounds:
-                    return this.VisitNewArray((NewArrayExpression)exp);
-                case ExpressionType.Invoke:
-                    return this.VisitInvocation((InvocationExpression)exp);
-                case ExpressionType.MemberInit:
-                    return this.VisitMemberInit((MemberInitExpression)exp);
-                case ExpressionType.ListInit:
-                    return this.VisitListInit((ListInitExpression)exp);
-                default:
-                    throw new InvalidOperationException();
-            }
-        }
-
-        protected virtual MemberBinding VisitBinding(MemberBinding binding)
-        {
-            switch (binding.BindingType)
-            {
-                case MemberBindingType.Assignment:
-                    return this.VisitMemberAssignment((MemberAssignment)binding);
-                case MemberBindingType.MemberBinding:
-                    return this.VisitMemberMemberBinding((MemberMemberBinding)binding);
-                case MemberBindingType.ListBinding:
-                    return this.VisitMemberListBinding((MemberListBinding)binding);
-                default:
-                    throw new InvalidOperationException();
-            }
-        }
-
-        protected virtual ElementInit VisitElementInitializer(ElementInit initializer)
-        {
-            ReadOnlyCollection<Expression> arguments = this.VisitExpressionList(initializer.Arguments);
-            if (arguments != initializer.Arguments)
-            {
-                return Expression.ElementInit(initializer.AddMethod, arguments);
-            }
-            return initializer;
-        }
-
-        protected virtual Expression VisitUnary(UnaryExpression u)
-        {
-            Expression operand = this.Visit(u.Operand);
-            if (operand != u.Operand)
-            {
-                return Expression.MakeUnary(u.NodeType, operand, u.Type, u.Method);
-            }
-            return u;
-        }
-
-        protected virtual Expression VisitBinary(BinaryExpression b)
-        {
-            Expression left = this.Visit(b.Left);
-            Expression right = this.Visit(b.Right);
-            Expression conversion = this.Visit(b.Conversion);
-            if (left != b.Left || right != b.Right || conversion != b.Conversion)
-            {
-                if (b.NodeType == ExpressionType.Coalesce && b.Conversion != null)
-                    return Expression.Coalesce(left, right, conversion as LambdaExpression);
-                else
-                    return Expression.MakeBinary(b.NodeType, left, right, b.IsLiftedToNull, b.Method);
-            }
-            return b;
-        }
-
-        protected virtual Expression VisitTypeIs(TypeBinaryExpression b)
-        {
-            Expression expr = this.Visit(b.Expression);
-            if (expr != b.Expression)
-            {
-                return Expression.TypeIs(expr, b.TypeOperand);
-            }
-            return b;
-        }
-
-        protected virtual Expression VisitConstant(ConstantExpression c)
-        {
-            return c;
-        }
-
-        protected virtual Expression VisitConditional(ConditionalExpression c)
-        {
-            Expression test = this.Visit(c.Test);
-            Expression ifTrue = this.Visit(c.IfTrue);
-            Expression ifFalse = this.Visit(c.IfFalse);
-            if (test != c.Test || ifTrue != c.IfTrue || ifFalse != c.IfFalse)
-            {
-                return Expression.Condition(test, ifTrue, ifFalse);
-            }
-            return c;
-        }
-
-        protected virtual Expression VisitParameter(ParameterExpression p)
-        {
-            return p;
-        }
-
-        protected virtual Expression VisitMemberAccess(MemberExpression m)
-        {
-            Expression exp = this.Visit(m.Expression);
-            if (exp != m.Expression)
-            {
-                return Expression.MakeMemberAccess(exp, m.Member);
-            }
-            return m;
-        }
-
-        protected virtual Expression VisitMethodCall(MethodCallExpression m)
-        {
-            Expression obj = this.Visit(m.Object);
-            IEnumerable<Expression> args = this.VisitExpressionList(m.Arguments);
-            if (obj != m.Object || args != m.Arguments)
-            {
-                return Expression.Call(obj, m.Method, args);
-            }
-            return m;
-        }
-
-        protected virtual ReadOnlyCollection<Expression> VisitExpressionList(ReadOnlyCollection<Expression> original)
-        {
-            List<Expression> list = null;
-            for (int i = 0, n = original.Count; i < n; i++)
-            {
-                Expression p = this.Visit(original[i]);
-                if (list != null)
-                {
-                    list.Add(p);
-                }
-                else if (p != original[i])
-                {
-                    list = new List<Expression>(n);
-                    for (int j = 0; j < i; j++)
-                    {
-                        list.Add(original[j]);
-                    }
-                    list.Add(p);
-                }
-            }
-            if (list != null)
-                return new ReadOnlyCollection<Expression>(list);
-            return original;
-        }
-
-        protected virtual MemberAssignment VisitMemberAssignment(MemberAssignment assignment)
-        {
-            Expression e = this.Visit(assignment.Expression);
-            if (e != assignment.Expression)
-            {
-                return Expression.Bind(assignment.Member, e);
-            }
-            return assignment;
-        }
-
-        protected virtual MemberMemberBinding VisitMemberMemberBinding(MemberMemberBinding binding)
-        {
-            IEnumerable<MemberBinding> bindings = this.VisitBindingList(binding.Bindings);
-            if (bindings != binding.Bindings)
-            {
-                return Expression.MemberBind(binding.Member, bindings);
-            }
-            return binding;
-        }
-
-        protected virtual MemberListBinding VisitMemberListBinding(MemberListBinding binding)
-        {
-            IEnumerable<ElementInit> initializers = this.VisitElementInitializerList(binding.Initializers);
-            if (initializers != binding.Initializers)
-            {
-                return Expression.ListBind(binding.Member, initializers);
-            }
-            return binding;
-        }
-
-        protected virtual IEnumerable<MemberBinding> VisitBindingList(ReadOnlyCollection<MemberBinding> original)
-        {
-            List<MemberBinding> list = null;
-            for (int i = 0, n = original.Count; i < n; i++)
-            {
-                MemberBinding b = this.VisitBinding(original[i]);
-                if (list != null)
-                {
-                    list.Add(b);
-                }
-                else if (b != original[i])
-                {
-                    list = new List<MemberBinding>(n);
-                    for (int j = 0; j < i; j++)
-                    {
-                        list.Add(original[j]);
-                    }
-                    list.Add(b);
-                }
-            }
-            if (list != null)
-                return list;
-            return original;
-        }
-
-        protected virtual IEnumerable<ElementInit> VisitElementInitializerList(ReadOnlyCollection<ElementInit> original)
-        {
-            List<ElementInit> list = null;
-            for (int i = 0, n = original.Count; i < n; i++)
-            {
-                ElementInit init = this.VisitElementInitializer(original[i]);
-                if (list != null)
-                {
-                    list.Add(init);
-                }
-                else if (init != original[i])
-                {
-                    list = new List<ElementInit>(n);
-                    for (int j = 0; j < i; j++)
-                    {
-                        list.Add(original[j]);
-                    }
-                    list.Add(init);
-                }
-            }
-            if (list != null)
-                return list;
-            return original;
-        }
-
-        protected virtual Expression VisitLambda(LambdaExpression lambda)
-        {
-            Expression body = this.Visit(lambda.Body);
-            if (body != lambda.Body)
-            {
-                return Expression.Lambda(lambda.Type, body, lambda.Parameters);
-            }
-            return lambda;
-        }
-
-        protected virtual NewExpression VisitNew(NewExpression nex)
-        {
-            IEnumerable<Expression> args = this.VisitExpressionList(nex.Arguments);
-            if (args != nex.Arguments)
-            {
-                if (nex.Members != null)
-                    return Expression.New(nex.Constructor, args, nex.Members);
-                else
-                    return Expression.New(nex.Constructor, args);
-            }
-            return nex;
-        }
-
-        protected virtual Expression VisitMemberInit(MemberInitExpression init)
-        {
-            NewExpression n = this.VisitNew(init.NewExpression);
-            IEnumerable<MemberBinding> bindings = this.VisitBindingList(init.Bindings);
-            if (n != init.NewExpression || bindings != init.Bindings)
-            {
-                return Expression.MemberInit(n, bindings);
-            }
-            return init;
-        }
-
-        protected virtual Expression VisitListInit(ListInitExpression init)
-        {
-            NewExpression n = this.VisitNew(init.NewExpression);
-            IEnumerable<ElementInit> initializers = this.VisitElementInitializerList(init.Initializers);
-            if (n != init.NewExpression || initializers != init.Initializers)
-            {
-                return Expression.ListInit(n, initializers);
-            }
-            return init;
-        }
-
-        protected virtual Expression VisitNewArray(NewArrayExpression na)
-        {
-            IEnumerable<Expression> exprs = this.VisitExpressionList(na.Expressions);
-            if (exprs != na.Expressions)
-            {
-                if (na.NodeType == ExpressionType.NewArrayInit)
-                {
-                    return Expression.NewArrayInit(na.Type.GetElementType(), exprs);
-                }
-                else
-                {
-                    return Expression.NewArrayBounds(na.Type.GetElementType(), exprs);
-                }
-            }
-            return na;
-        }
-
-        protected virtual Expression VisitInvocation(InvocationExpression iv)
-        {
-            IEnumerable<Expression> args = this.VisitExpressionList(iv.Arguments);
-            Expression expr = this.Visit(iv.Expression);
-            if (args != iv.Arguments || expr != iv.Expression)
-            {
-                return Expression.Invoke(expr, args);
-            }
-            return iv;
-        }
-    }
-}
-
-#endif

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Linq/IQbservable.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. 
 
-#if !NO_EXPRESSIONS
 using System.Linq.Expressions;
 
 namespace System.Reactive.Linq
@@ -41,4 +40,3 @@ namespace System.Reactive.Linq
         IQbservableProvider Provider { get; }
     }
 }
-#endif

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Linq/IQbservableProvider.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. 
 
-#if !NO_EXPRESSIONS
 using System.Linq.Expressions;
 
 namespace System.Reactive.Linq
@@ -22,4 +21,3 @@ namespace System.Reactive.Linq
         IQbservable<TResult> CreateQuery<TResult>(Expression expression);
     }
 }
-#endif

+ 1 - 27
Rx.NET/Source/src/System.Reactive/Linq/IQueryLanguage.cs

@@ -8,14 +8,8 @@ using System.Reactive.Concurrency;
 using System.Reactive.Joins;
 using System.Reactive.Subjects;
 using System.Threading;
-
-#if !NO_REMOTING
-
-#endif
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
+
 
 namespace System.Reactive.Linq
 {
@@ -199,24 +193,19 @@ namespace System.Reactive.Linq
         IObservable<TSource> Start<TSource>(Func<TSource> function);
         IObservable<TSource> Start<TSource>(Func<TSource> function, IScheduler scheduler);
 
-#if !NO_TPL
         IObservable<TSource> StartAsync<TSource>(Func<Task<TSource>> functionAsync);
         IObservable<TSource> StartAsync<TSource>(Func<CancellationToken, Task<TSource>> functionAsync);
         IObservable<TSource> StartAsync<TSource>(Func<Task<TSource>> functionAsync, IScheduler scheduler);
         IObservable<TSource> StartAsync<TSource>(Func<CancellationToken, Task<TSource>> functionAsync, IScheduler scheduler);
-#endif
 
         IObservable<Unit> Start(Action action);
         IObservable<Unit> Start(Action action, IScheduler scheduler);
 
-#if !NO_TPL
         IObservable<Unit> StartAsync(Func<Task> actionAsync);
         IObservable<Unit> StartAsync(Func<CancellationToken, Task> actionAsync);
         IObservable<Unit> StartAsync(Func<Task> actionAsync, IScheduler scheduler);
         IObservable<Unit> StartAsync(Func<CancellationToken, Task> actionAsync, IScheduler scheduler);
-#endif
 
-#if !NO_TPL
         IObservable<TResult> FromAsync<TResult>(Func<Task<TResult>> functionAsync);
         IObservable<TResult> FromAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync);
         IObservable<Unit> FromAsync(Func<Task> actionAsync);
@@ -225,7 +214,6 @@ namespace System.Reactive.Linq
         IObservable<TResult> FromAsync<TResult>(Func<CancellationToken, Task<TResult>> functionAsync, IScheduler scheduler);
         IObservable<Unit> FromAsync(Func<Task> actionAsync, IScheduler scheduler);
         IObservable<Unit> FromAsync(Func<CancellationToken, Task> actionAsync, IScheduler scheduler);
-#endif
 
         Func<IObservable<TResult>> ToAsync<TResult>(Func<TResult> function);
         Func<IObservable<TResult>> ToAsync<TResult>(Func<TResult> function, IScheduler scheduler);
@@ -395,22 +383,17 @@ namespace System.Reactive.Linq
 
         IObservable<TSource> Create<TSource>(Func<IObserver<TSource>, IDisposable> subscribe);
         IObservable<TSource> Create<TSource>(Func<IObserver<TSource>, Action> subscribe);
-
-#if !NO_TPL
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<IDisposable>> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task<IDisposable>> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task<Action>> subscribeAsync);
         IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, Task<Action>> subscribeAsync);
-#endif
 
         IObservable<TValue> Defer<TValue>(Func<IObservable<TValue>> observableFactory);
 
-#if !NO_TPL
         IObservable<TValue> Defer<TValue>(Func<Task<IObservable<TValue>>> observableFactoryAsync);
         IObservable<TValue> Defer<TValue>(Func<CancellationToken, Task<IObservable<TValue>>> observableFactoryAsync);
-#endif
 
         IObservable<TResult> Empty<TResult>();
         IObservable<TResult> Empty<TResult>(IScheduler scheduler);
@@ -428,10 +411,7 @@ namespace System.Reactive.Linq
         IObservable<TResult> Throw<TResult>(Exception exception);
         IObservable<TResult> Throw<TResult>(Exception exception, IScheduler scheduler);
         IObservable<TSource> Using<TSource, TResource>(Func<TResource> resourceFactory, Func<TResource, IObservable<TSource>> observableFactory) where TResource : IDisposable;
-
-#if !NO_TPL
         IObservable<TSource> Using<TSource, TResource>(Func<CancellationToken, Task<TResource>> resourceFactoryAsync, Func<TResource, CancellationToken, Task<IObservable<TSource>>> observableFactoryAsync) where TResource : IDisposable;
-#endif
 
         #endregion
 
@@ -473,12 +453,10 @@ namespace System.Reactive.Linq
 
         #region * Imperative *
 
-#if !NO_TPL
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource> onNext);
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource> onNext, CancellationToken cancellationToken);
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource, int> onNext);
         Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource, int> onNext, CancellationToken cancellationToken);
-#endif
 
         IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IObservable<TResult> defaultSource);
         IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources, IScheduler scheduler);
@@ -587,11 +565,9 @@ namespace System.Reactive.Linq
 
         IObservable<TResult> Zip<TFirst, TSecond, TResult>(IObservable<TFirst> first, IEnumerable<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector);
 
-#if !NO_TPL
         IObservable<TSource> Concat<TSource>(IObservable<Task<TSource>> sources);
         IObservable<TSource> Merge<TSource>(IObservable<Task<TSource>> sources);
         IObservable<TSource> Switch<TSource>(IObservable<Task<TSource>> sources);
-#endif
 
         #endregion
 
@@ -683,7 +659,6 @@ namespace System.Reactive.Linq
         IObservable<TSource> Where<TSource>(IObservable<TSource> source, Func<TSource, bool> predicate);
         IObservable<TSource> Where<TSource>(IObservable<TSource> source, Func<TSource, int, bool> predicate);
 
-#if !NO_TPL
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TResult>> selector);
         IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector);
@@ -692,7 +667,6 @@ namespace System.Reactive.Linq
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector);
         IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TTaskResult>> taskSelector, Func<TSource, int, TTaskResult, TResult> resultSelector);
-#endif
 
         #endregion
 

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

@@ -147,9 +147,9 @@ namespace System.Reactive.Linq
         #region + Average +
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Double" /> values.
+        /// Computes the average of an observable sequence of <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Double" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of <see cref="double" /> 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>
@@ -163,9 +163,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Single" /> values.
+        /// Computes the average of an observable sequence of <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Single" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of <see cref="float" /> 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>
@@ -196,9 +196,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Int32" /> values.
+        /// Computes the average of an observable sequence of <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int32" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of <see cref="int" /> 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>
@@ -213,9 +213,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Int64" /> values.
+        /// Computes the average of an observable sequence of <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int64" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of <see cref="long" /> 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>
@@ -230,9 +230,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Double" /> values.
+        /// Computes the average of an observable sequence of nullable <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Double" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of nullable <see cref="double" /> 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>
@@ -246,9 +246,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Single" /> values.
+        /// Computes the average of an observable sequence of nullable <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Single" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of nullable <see cref="float" /> 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>
@@ -279,9 +279,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Int32" /> values.
+        /// Computes the average of an observable sequence of nullable <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int32" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of nullable <see cref="int" /> 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>
@@ -296,9 +296,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Int64" /> values.
+        /// Computes the average of an observable sequence of nullable <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int64" /> values to calculate the average of.</param>
+        /// <param name="source">A sequence of nullable <see cref="long" /> 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>
@@ -334,7 +334,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Double" /> 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="double" /> 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>
@@ -354,7 +354,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Single" /> 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="float" /> 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>
@@ -374,7 +374,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Int32" /> 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="int" /> 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>
@@ -395,7 +395,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of <see cref="Int64" /> 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="long" /> 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>
@@ -437,7 +437,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Double" /> 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="double" /> 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>
@@ -457,7 +457,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Single" /> 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="float" /> 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>
@@ -477,7 +477,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Int32" /> 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="int" /> 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>
@@ -498,7 +498,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the average of an observable sequence of nullable <see cref="Int64" /> 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="long" /> 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>
@@ -564,7 +564,7 @@ namespace System.Reactive.Linq
         #region + Count +
 
         /// <summary>
-        /// Returns an observable sequence containing an <see cref="Int32" /> that represents the total number of elements in an observable sequence.
+        /// Returns an observable sequence containing an <see cref="int" /> that represents the total number of elements in an observable sequence.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">An observable sequence that contains elements to be counted.</param>
@@ -581,7 +581,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns an observable sequence containing an <see cref="Int32" /> that represents how many elements in the specified observable sequence satisfy a condition.
+        /// Returns an observable sequence containing an <see cref="int" /> that represents how many elements in the specified observable sequence satisfy a condition.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">An observable sequence that contains elements to be counted.</param>
@@ -822,7 +822,7 @@ namespace System.Reactive.Linq
         #region + LongCount +
 
         /// <summary>
-        /// Returns an observable sequence containing an <see cref="Int64" /> that represents the total number of elements in an observable sequence.
+        /// Returns an observable sequence containing an <see cref="long" /> that represents the total number of elements in an observable sequence.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">An observable sequence that contains elements to be counted.</param>
@@ -839,7 +839,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns an observable sequence containing an <see cref="Int64" /> that represents how many elements in the specified observable sequence satisfy a condition.
+        /// Returns an observable sequence containing an <see cref="long" /> that represents how many elements in the specified observable sequence satisfy a condition.
         /// </summary>
         /// <typeparam name="TSource">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">An observable sequence that contains elements to be counted.</param>
@@ -897,9 +897,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of <see cref="Double" /> values.
+        /// Returns the maximum value in an observable sequence of <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Double" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of <see cref="double" /> 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>
@@ -912,9 +912,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of <see cref="Single" /> values.
+        /// Returns the maximum value in an observable sequence of <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Single" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of <see cref="float" /> 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>
@@ -942,9 +942,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of <see cref="Int32" /> values.
+        /// Returns the maximum value in an observable sequence of <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int32" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of <see cref="int" /> 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>
@@ -957,9 +957,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of <see cref="Int64" /> values.
+        /// Returns the maximum value in an observable sequence of <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int64" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of <see cref="long" /> 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>
@@ -972,9 +972,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of nullable <see cref="Double" /> values.
+        /// Returns the maximum value in an observable sequence of nullable <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Double" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="double" /> 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>
@@ -987,9 +987,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of nullable <see cref="Single" /> values.
+        /// Returns the maximum value in an observable sequence of nullable <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Single" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="float" /> 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>
@@ -1017,9 +1017,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of nullable <see cref="Int32" /> values.
+        /// Returns the maximum value in an observable sequence of nullable <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int32" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="int" /> 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>
@@ -1032,9 +1032,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the maximum value in an observable sequence of nullable <see cref="Int64" /> values.
+        /// Returns the maximum value in an observable sequence of nullable <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int64" /> values to determine the maximum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="long" /> 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>
@@ -1090,12 +1090,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="Double" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="double" /> 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="Double" /> 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="double" /> 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<double> Max<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
@@ -1109,12 +1109,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="Single" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="float" /> 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="Single" /> 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="float" /> 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<float> Max<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
@@ -1147,12 +1147,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="Int32" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="int" /> 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="Int32" /> 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="int" /> 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<int> Max<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
@@ -1166,12 +1166,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="Int64" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum <see cref="long" /> 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="Int64" /> 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="long" /> 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<long> Max<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
@@ -1185,7 +1185,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="Double" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="double" /> 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>
@@ -1204,7 +1204,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="Single" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="float" /> 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>
@@ -1242,7 +1242,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="Int32" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="int" /> 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>
@@ -1261,7 +1261,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="Int64" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the maximum nullable <see cref="long" /> 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>
@@ -1366,9 +1366,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of <see cref="Double" /> values.
+        /// Returns the minimum value in an observable sequence of <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Double" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of <see cref="double" /> 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>
@@ -1381,9 +1381,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of <see cref="Single" /> values.
+        /// Returns the minimum value in an observable sequence of <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Single" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of <see cref="float" /> 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>
@@ -1411,9 +1411,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of <see cref="Int32" /> values.
+        /// Returns the minimum value in an observable sequence of <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int32" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of <see cref="int" /> 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>
@@ -1426,9 +1426,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of <see cref="Int64" /> values.
+        /// Returns the minimum value in an observable sequence of <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int64" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of <see cref="long" /> 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>
@@ -1441,9 +1441,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of nullable <see cref="Double" /> values.
+        /// Returns the minimum value in an observable sequence of nullable <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Double" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="double" /> 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>
@@ -1456,9 +1456,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of nullable <see cref="Single" /> values.
+        /// Returns the minimum value in an observable sequence of nullable <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Single" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="float" /> 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>
@@ -1486,9 +1486,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of nullable <see cref="Int32" /> values.
+        /// Returns the minimum value in an observable sequence of nullable <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int32" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="int" /> 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>
@@ -1501,9 +1501,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Returns the minimum value in an observable sequence of nullable <see cref="Int64" /> values.
+        /// Returns the minimum value in an observable sequence of nullable <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int64" /> values to determine the minimum value of.</param>
+        /// <param name="source">A sequence of nullable <see cref="long" /> 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>
@@ -1559,12 +1559,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="Double" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="double" /> 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="Double" /> 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="double" /> 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<double> Min<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
@@ -1578,12 +1578,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="Single" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="float" /> 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="Single" /> 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="float" /> 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<float> Min<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
@@ -1616,12 +1616,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="Int32" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="int" /> 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="Int32" /> 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="int" /> 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<int> Min<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
@@ -1635,12 +1635,12 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="Int64" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum <see cref="long" /> 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="Int64" /> 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="long" /> 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<long> Min<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
@@ -1654,7 +1654,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="Double" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="double" /> 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>
@@ -1673,7 +1673,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="Single" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="float" /> 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>
@@ -1711,7 +1711,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="Int32" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="int" /> 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>
@@ -1730,7 +1730,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="Int64" /> value.
+        /// Invokes a transform function on each element of a sequence and returns the minimum nullable <see cref="long" /> 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>
@@ -1964,9 +1964,9 @@ namespace System.Reactive.Linq
         #region + Sum +
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Double" /> values.
+        /// Computes the sum of a sequence of <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Double" /> values to calculate the sum of.</param>
+        /// <param name="source">A sequence of <see cref="double" /> 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>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -1979,9 +1979,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Single" /> values.
+        /// Computes the sum of a sequence of <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Single" /> values to calculate the sum of.</param>
+        /// <param name="source">A sequence of <see cref="float" /> 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>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -2010,9 +2010,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Int32" /> values.
+        /// Computes the sum of a sequence of <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int32" /> values to calculate the sum of.</param>
+        /// <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>
@@ -2026,9 +2026,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Int64" /> values.
+        /// Computes the sum of a sequence of <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of <see cref="Int64" /> values to calculate the sum of.</param>
+        /// <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>
@@ -2042,9 +2042,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Double" /> values.
+        /// Computes the sum of a sequence of nullable <see cref="double" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Double" /> values to calculate the sum of.</param>
+        /// <param name="source">A sequence of nullable <see cref="double" /> 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>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -2057,9 +2057,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Single" /> values.
+        /// Computes the sum of a sequence of nullable <see cref="float" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Single" /> values to calculate the sum of.</param>
+        /// <param name="source">A sequence of nullable <see cref="float" /> 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>
         /// <remarks>The return type of this operator differs from the corresponding operator on IEnumerable in order to retain asynchronous behavior.</remarks>
@@ -2088,9 +2088,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Int32" /> values.
+        /// Computes the sum of a sequence of nullable <see cref="int" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int32" /> values to calculate the sum of.</param>
+        /// <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>
@@ -2104,9 +2104,9 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Int64" /> values.
+        /// Computes the sum of a sequence of nullable <see cref="long" /> values.
         /// </summary>
-        /// <param name="source">A sequence of nullable <see cref="Int64" /> values to calculate the sum of.</param>
+        /// <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>
@@ -2120,7 +2120,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Double" /> 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="double" /> 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>
@@ -2139,7 +2139,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Single" /> 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="float" /> 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>
@@ -2178,7 +2178,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Int32" /> 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="int" /> 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>
@@ -2198,7 +2198,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of <see cref="Int64" /> 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="long" /> 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>
@@ -2218,7 +2218,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Double" /> 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="double" /> 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>
@@ -2237,7 +2237,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Single" /> 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="float" /> 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>
@@ -2276,7 +2276,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Int32" /> 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="int" /> 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>
@@ -2296,7 +2296,7 @@ namespace System.Reactive.Linq
         }
 
         /// <summary>
-        /// Computes the sum of a sequence of nullable <see cref="Int64" /> 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="long" /> 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>

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

@@ -927,7 +927,6 @@ namespace System.Reactive.Linq
             return s_impl.Start<TResult>(function, scheduler);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous function, surfacing the result through an observable sequence.
         /// </summary>
@@ -1033,7 +1032,6 @@ namespace System.Reactive.Linq
 
             return s_impl.StartAsync<TResult>(functionAsync, scheduler);
         }
-#endif
 
         #endregion
 
@@ -1082,7 +1080,6 @@ namespace System.Reactive.Linq
             return s_impl.Start(action, scheduler);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Invokes the asynchronous action, surfacing the result through an observable sequence.
         /// </summary>
@@ -1184,7 +1181,6 @@ namespace System.Reactive.Linq
 
             return s_impl.StartAsync(actionAsync, scheduler);
         }
-#endif
 
         #endregion
 

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

@@ -5,10 +5,7 @@
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -60,7 +57,6 @@ namespace System.Reactive.Linq
 
         #region + CreateAsync +
 
-#if !NO_TPL
         /// <summary>
         /// Creates an observable sequence from a specified cancellable asynchronous Subscribe method.
         /// The CancellationToken passed to the asynchronous Subscribe method is tied to the returned disposable subscription, allowing best-effort cancellation.
@@ -162,7 +158,6 @@ namespace System.Reactive.Linq
 
             return s_impl.Create<TResult>(subscribeAsync);
         }
-#endif
 
         #endregion
 
@@ -187,7 +182,6 @@ namespace System.Reactive.Linq
 
         #region + DeferAsync +
 
-#if !NO_TPL
         /// <summary>
         /// Returns an observable sequence that starts the specified asynchronous factory function whenever a new observer subscribes.
         /// </summary>
@@ -221,7 +215,6 @@ namespace System.Reactive.Linq
 
             return s_impl.Defer<TResult>(observableFactoryAsync);
         }
-#endif
 
         #endregion
 
@@ -595,8 +588,6 @@ namespace System.Reactive.Linq
 
         #region + UsingAsync +
 
-#if !NO_TPL
-
         /// <summary>
         /// Constructs an observable sequence that depends on a resource object, whose lifetime is tied to the resulting observable sequence's lifetime. The resource is obtained and used through asynchronous methods.
         /// The CancellationToken passed to the asynchronous methods is tied to the returned disposable subscription, allowing best-effort cancellation at any stage of the resource acquisition or usage.
@@ -619,8 +610,6 @@ namespace System.Reactive.Linq
             return s_impl.Using<TResult, TResource>(resourceFactoryAsync, observableFactoryAsync);
         }
 
-#endif
-
         #endregion
     }
 }

+ 0 - 5
Rx.NET/Source/src/System.Reactive/Linq/Observable.Imperative.cs

@@ -5,10 +5,7 @@
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -16,7 +13,6 @@ namespace System.Reactive.Linq
     {
         #region + ForEachAsync +
 
-#if !NO_TPL
         /// <summary>
         /// Invokes an action for each element in the observable sequence, and returns a Task object that will get signaled when the sequence terminates.
         /// </summary>
@@ -96,7 +92,6 @@ namespace System.Reactive.Linq
 
             return s_impl.ForEachAsync<TSource>(source, onNext, cancellationToken);
         }
-#endif
 
         #endregion
 

+ 0 - 15
Rx.NET/Source/src/System.Reactive/Linq/Observable.Multiple.cs

@@ -4,11 +4,8 @@
 
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
-
-#if !NO_TPL
 using System.Threading; // Used in XML doc comments
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -1098,8 +1095,6 @@ namespace System.Reactive.Linq
             return s_impl.Concat<TSource>(sources);
         }
 
-#if !NO_TPL
-
         /// <summary>
         /// Concatenates all task results, as long as the previous task terminated successfully.
         /// </summary>
@@ -1116,8 +1111,6 @@ namespace System.Reactive.Linq
             return s_impl.Concat<TSource>(sources);
         }
 
-#endif
-
         #endregion
 
         #region + Merge +
@@ -1137,8 +1130,6 @@ namespace System.Reactive.Linq
             return s_impl.Merge<TSource>(sources);
         }
 
-#if !NO_TPL
-
         /// <summary>
         /// Merges results from all source tasks into a single observable sequence.
         /// </summary>
@@ -1155,8 +1146,6 @@ namespace System.Reactive.Linq
             return s_impl.Merge<TSource>(sources);
         }
 
-#endif
-
         /// <summary>
         /// Merges elements from all inner observable sequences into a single observable sequence, limiting the number of concurrent subscriptions to inner sequences.
         /// </summary>
@@ -1419,8 +1408,6 @@ namespace System.Reactive.Linq
             return s_impl.Switch<TSource>(sources);
         }
 
-#if !NO_TPL
-
         /// <summary>
         /// Transforms an observable sequence of tasks into an observable sequence 
         /// producing values only from the most recent observable sequence.
@@ -1439,8 +1426,6 @@ namespace System.Reactive.Linq
             return s_impl.Switch<TSource>(sources);
         }
 
-#endif
-
         #endregion
 
         #region + TakeUntil +

+ 0 - 7
Rx.NET/Source/src/System.Reactive/Linq/Observable.StandardSequenceOperators.cs

@@ -4,12 +4,9 @@
 
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks; // needed for doc comments
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -813,7 +810,6 @@ namespace System.Reactive.Linq
             return s_impl.SelectMany<TSource, TResult>(source, selector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task and merges all of the task results into one observable sequence.
         /// </summary>
@@ -893,7 +889,6 @@ namespace System.Reactive.Linq
 
             return s_impl.SelectMany<TSource, TResult>(source, selector);
         }
-#endif
 
         /// <summary>
         /// Projects each element of an observable sequence to an observable sequence, invokes the result selector for the source element and each of the corresponding inner sequence's elements, and merges the results into one observable sequence.
@@ -941,7 +936,6 @@ namespace System.Reactive.Linq
             return s_impl.SelectMany<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
         }
 
-#if !NO_TPL
         /// <summary>
         /// Projects each element of an observable sequence to a task, invokes the result selector for the source element and the task result, and merges the results into one observable sequence.
         /// </summary>
@@ -1037,7 +1031,6 @@ namespace System.Reactive.Linq
 
             return s_impl.SelectMany<TSource, TTaskResult, TResult>(source, taskSelector, resultSelector);
         }
-#endif
 
         /// <summary>
         /// Projects each notification of an observable sequence to an observable sequence and merges the resulting observable sequences into one observable sequence.

+ 0 - 33
Rx.NET/Source/src/System.Reactive/Linq/Observable/Delay.cs

@@ -336,14 +336,8 @@ namespace System.Reactive.Linq.ObservableImpl
             private IStopwatch _watch;
 
             private object _gate;
-#if !NO_CDS
             private SemaphoreSlim _evt;
             private CancellationTokenSource _stop;
-#else
-            private Semaphore _evt;
-            private bool _stopped;
-            private ManualResetEvent _stop;
-#endif
             private Queue<System.Reactive.TimeInterval<TSource>> _queue;
             private bool _hasCompleted;
             private TimeSpan _completeAt;
@@ -355,11 +349,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 _cancelable = new SerialDisposable();
 
                 _gate = new object();
-#if !NO_CDS
                 _evt = new SemaphoreSlim(0);
-#else
-                _evt = new Semaphore(0, int.MaxValue);
-#endif
                 _queue = new Queue<System.Reactive.TimeInterval<TSource>>();
                 _hasCompleted = false;
                 _completeAt = default(TimeSpan);
@@ -408,18 +398,8 @@ namespace System.Reactive.Linq.ObservableImpl
 
             private void ScheduleDrain()
             {
-#if !NO_CDS
                 _stop = new CancellationTokenSource();
                 _cancelable.Disposable = Disposable.Create(() => _stop.Cancel());
-#else
-                _stop = new ManualResetEvent(false);
-                _cancelable.Disposable = Disposable.Create(() =>
-                {
-                    _stopped = true;
-                    _stop.Set();
-                    _evt.Release();
-                });
-#endif
 
                 _parent._scheduler.AsLongRunning().ScheduleLongRunning(DrainQueue);
             }
@@ -470,7 +450,6 @@ namespace System.Reactive.Linq.ObservableImpl
             {
                 while (true)
                 {
-#if !NO_CDS
                     try
                     {
                         _evt.Wait(_stop.Token);
@@ -479,11 +458,6 @@ namespace System.Reactive.Linq.ObservableImpl
                     {
                         return;
                     }
-#else
-                    _evt.WaitOne();
-                    if (_stopped)
-                        return;
-#endif
 
                     var hasFailed = false;
                     var error = default(Exception);
@@ -535,7 +509,6 @@ namespace System.Reactive.Linq.ObservableImpl
 
                     if (shouldWait)
                     {
-#if !NO_CDS
                         var timer = new ManualResetEventSlim();
                         _parent._scheduler.Schedule(waitTime, () => { timer.Set(); });
 
@@ -547,12 +520,6 @@ namespace System.Reactive.Linq.ObservableImpl
                         {
                             return;
                         }
-#else
-                        var timer = new ManualResetEvent(false);
-                        _parent._scheduler.Schedule(waitTime, () => { timer.Set(); });
-                        if (WaitHandle.WaitAny(new[] { timer, _stop }) == 1)
-                            return;
-#endif
                     }
 
                     if (hasValue)

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

@@ -2,7 +2,7 @@
 // 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. 
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
 using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;

+ 0 - 56
Rx.NET/Source/src/System.Reactive/Linq/Observable/GroupByUntil.cs

@@ -277,7 +277,6 @@ namespace System.Reactive.Linq.ObservableImpl
         }
     }
 
-#if !NO_CDS
     class Map<TKey, TValue>
     {
         // Taken from ConcurrentDictionary in the BCL.
@@ -351,60 +350,5 @@ namespace System.Reactive.Linq.ObservableImpl
             return _map.TryRemove(key, out value);
         }
     }
-#else
-    class Map<TKey, TValue>
-    {
-        private readonly Dictionary<TKey, TValue> _map;
-
-        public Map(int? capacity, IEqualityComparer<TKey> comparer)
-        {
-            if (capacity.HasValue)
-            {
-                _map = new Dictionary<TKey, TValue>(capacity.Value, comparer);
-            }
-            else
-            {
-                _map = new Dictionary<TKey, TValue>(comparer);
-            }
-        }
-
-        public TValue GetOrAdd(TKey key, Func<TValue> valueFactory, out bool added)
-        {
-            lock (_map)
-            {
-                added = false;
-
-                var value = default(TValue);
-                if (!_map.TryGetValue(key, out value))
-                {
-                    value = valueFactory();
-                    _map.Add(key, value);
-                    added = true;
-                }
-
-                return value;
-            }
-        }
-
-        public IEnumerable<TValue> Values
-        {
-            get
-            {
-                lock (_map)
-                {
-                    return _map.Values.ToArray();
-                }
-            }
-        }
-
-        public bool Remove(TKey key)
-        {
-            lock (_map)
-            {
-                return _map.Remove(key);
-            }
-        }
-    }
-#endif
 }
 #endif

+ 0 - 14
Rx.NET/Source/src/System.Reactive/Linq/Observable/Latest.cs

@@ -25,23 +25,13 @@ namespace System.Reactive.Linq.ObservableImpl
         class _ : PushToPullSink<TSource, TSource>
         {
             private readonly object _gate;
-
-#if !NO_CDS
             private readonly SemaphoreSlim _semaphore;
-#else
-            private readonly Semaphore _semaphore;
-#endif
 
             public _(IDisposable subscription)
                 : base(subscription)
             {
                 _gate = new object();
-
-#if !NO_CDS
                 _semaphore = new SemaphoreSlim(0, 1);
-#else
-                _semaphore = new Semaphore(0, 1);
-#endif
             }
 
             private bool _notificationAvailable;
@@ -103,11 +93,7 @@ namespace System.Reactive.Linq.ObservableImpl
                 var value = default(TSource);
                 var error = default(Exception);
 
-#if !NO_CDS
                 _semaphore.Wait();
-#else
-                _semaphore.WaitOne();
-#endif
 
                 lock (_gate)
                 {

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

@@ -6,17 +6,15 @@
 using System;
 using System.Collections.Generic;
 using System.Reactive.Disposables;
-
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq.ObservableImpl
 {
     class Merge<TSource> : Producer<TSource>
     {
         private readonly IObservable<IObservable<TSource>> _sources;
+        private readonly IObservable<Task<TSource>> _sourcesT;
         private readonly int _maxConcurrent;
 
         public Merge(IObservable<IObservable<TSource>> sources)
@@ -30,14 +28,10 @@ namespace System.Reactive.Linq.ObservableImpl
             _maxConcurrent = maxConcurrent;
         }
 
-#if !NO_TPL
-        private readonly IObservable<Task<TSource>> _sourcesT;
-
         public Merge(IObservable<Task<TSource>> sources)
         {
             _sourcesT = sources;
         }
-#endif
 
         protected override IDisposable Run(IObserver<TSource> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
@@ -47,14 +41,12 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#if !NO_TPL
             else if (_sourcesT != null)
             {
                 var sink = new MergeImpl(this, observer, cancel);
                 setSink(sink);
                 return sink.Run();
             }
-#endif
             else
             {
                 var sink = new _(this, observer, cancel);
@@ -308,7 +300,6 @@ namespace System.Reactive.Linq.ObservableImpl
             }
         }
 
-#if !NO_TPL
         class MergeImpl : Sink<TSource>, IObserver<Task<TSource>>
         {
             private readonly Merge<TSource> _parent;
@@ -397,7 +388,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 }
             }
         }
-#endif
     }
 }
 #endif

+ 0 - 14
Rx.NET/Source/src/System.Reactive/Linq/Observable/Next.cs

@@ -25,23 +25,13 @@ namespace System.Reactive.Linq.ObservableImpl
         class _ : PushToPullSink<TSource, TSource>
         {
             private readonly object _gate;
-
-#if !NO_CDS
             private readonly SemaphoreSlim _semaphore;
-#else
-            private readonly Semaphore _semaphore;
-#endif
 
             public _(IDisposable subscription)
                 : base(subscription)
             {
                 _gate = new object();
-
-#if !NO_CDS
                 _semaphore = new SemaphoreSlim(0, 1);
-#else
-                _semaphore = new Semaphore(0, 1);
-#endif
             }
 
             private bool _waiting;
@@ -117,11 +107,7 @@ namespace System.Reactive.Linq.ObservableImpl
 
                 if (!done)
                 {
-#if !NO_CDS
                     _semaphore.Wait();
-#else
-                    _semaphore.WaitOne();
-#endif
                 }
 
                 //

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

@@ -5,11 +5,8 @@
 #if !NO_PERF
 using System.Collections.Generic;
 using System.Reactive.Disposables;
-
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq.ObservableImpl
 {
@@ -22,6 +19,9 @@ namespace System.Reactive.Linq.ObservableImpl
         private readonly Func<TSource, int, IEnumerable<TCollection>> _collectionSelectorEI;
         private readonly Func<TSource, TCollection, TResult> _resultSelector;
         private readonly Func<TSource, int, TCollection, int, TResult> _resultSelectorI;
+        private readonly Func<TSource, CancellationToken, Task<TCollection>> _collectionSelectorT;
+        private readonly Func<TSource, int, CancellationToken, Task<TCollection>> _collectionSelectorTI;
+        private readonly Func<TSource, int, TCollection, TResult> _resultSelectorTI;
 
         public SelectMany(IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
@@ -51,11 +51,6 @@ namespace System.Reactive.Linq.ObservableImpl
             _resultSelectorI = resultSelector;
         }
 
-#if !NO_TPL
-        private readonly Func<TSource, CancellationToken, Task<TCollection>> _collectionSelectorT;
-        private readonly Func<TSource, int, CancellationToken, Task<TCollection>> _collectionSelectorTI;
-        private readonly Func<TSource, int, TCollection, TResult> _resultSelectorTI;
-
         public SelectMany(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
             _source = source;
@@ -69,7 +64,6 @@ namespace System.Reactive.Linq.ObservableImpl
             _collectionSelectorTI = collectionSelector;
             _resultSelectorTI = resultSelector;
         }
-#endif
 
         protected override IDisposable Run(IObserver<TResult> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
@@ -85,7 +79,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#if !NO_TPL
             else if (_collectionSelectorT != null)
             {
                 var sink = new SelectManyImpl(this, observer, cancel);
@@ -98,7 +91,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#endif
             else if (_collectionSelectorE != null)
             {
                 var sink = new NoSelectorImpl(this, observer, cancel);
@@ -586,7 +578,6 @@ namespace System.Reactive.Linq.ObservableImpl
             }
         }
 
-#if !NO_TPL
         class SelectManyImpl : Sink<TResult>, IObserver<TSource>
         {
             private readonly SelectMany<TSource, TCollection, TResult> _parent;
@@ -857,7 +848,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 }
             }
         }
-#endif
     }
 
     class SelectMany<TSource, TResult> : Producer<TResult>
@@ -869,6 +859,8 @@ namespace System.Reactive.Linq.ObservableImpl
         private readonly Func<IObservable<TResult>> _selectorOnCompleted;
         private readonly Func<TSource, IEnumerable<TResult>> _selectorE;
         private readonly Func<TSource, int, IEnumerable<TResult>> _selectorEI;
+        private readonly Func<TSource, CancellationToken, Task<TResult>> _selectorT;
+        private readonly Func<TSource, int, CancellationToken, Task<TResult>> _selectorTI;
 
         public SelectMany(IObservable<TSource> source, Func<TSource, IObservable<TResult>> selector)
         {
@@ -910,22 +902,17 @@ namespace System.Reactive.Linq.ObservableImpl
             _selectorEI = selector;
         }
 
-#if !NO_TPL
-        private readonly Func<TSource, CancellationToken, Task<TResult>> _selectorT;
-        private readonly Func<TSource, int, CancellationToken, Task<TResult>> _selectorTI;
-
         public SelectMany(IObservable<TSource> source, Func<TSource, CancellationToken, Task<TResult>> selector)
         {
             _source = source;
             _selectorT = selector;
         }
-        
+
         public SelectMany(IObservable<TSource> source, Func<TSource, int, CancellationToken, Task<TResult>> selector)
         {
             _source = source;
             _selectorTI = selector;
         }
-#endif
 
         protected override IDisposable Run(IObserver<TResult> observer, IDisposable cancel, Action<IDisposable> setSink)
         {
@@ -941,7 +928,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#if !NO_TPL
             else if (_selectorT != null)
             {
                 var sink = new SelectManyImpl(this, observer, cancel);
@@ -954,7 +940,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 setSink(sink);
                 return sink.Run();
             }
-#endif
             else if (_selectorE != null)
             {
                 var sink = new NoSelectorImpl(this, observer, cancel);
@@ -1510,7 +1495,6 @@ namespace System.Reactive.Linq.ObservableImpl
             }
         }
 
-#if !NO_TPL
         class SelectManyImpl : Sink<TResult>, IObserver<TSource>
         {
             private readonly SelectMany<TSource, TResult> _parent;
@@ -1731,7 +1715,6 @@ namespace System.Reactive.Linq.ObservableImpl
                 }
             }
         }
-#endif
     }
 }
 #endif

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 101 - 141
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs


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

@@ -2,8 +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. 
 
-#if !NO_EXPRESSIONS
-
 #pragma warning disable 1591
 
 using System.Collections.Generic;
@@ -133,5 +131,3 @@ namespace System.Reactive.Linq
 }
 
 #pragma warning restore 1591
-
-#endif

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

@@ -5,8 +5,6 @@
 
 #pragma warning disable 1591
 
-#if !NO_EXPRESSIONS
-
 using System;
 using System.Reactive.Concurrency;
 using System.Collections.Generic;
@@ -15,11 +13,9 @@ using System.Linq;
 using System.Linq.Expressions;
 using System.Reflection;
 using System.Threading;
+using System.Threading.Tasks;
 using System.Reactive;
 using System.Reactive.Subjects;
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
 #if !NO_REMOTING
 using System.Runtime.Remoting.Lifetime;
 #endif
@@ -363,7 +359,5 @@ namespace System.Reactive.Linq
     }
 }
 
-#endif
-
 #pragma warning restore 1591
 

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.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. 
 
-#if !NO_EXPRESSIONS
 using System.Collections.Generic;
 using System.Linq;
 using System.Linq.Expressions;
@@ -56,4 +55,3 @@ namespace System.Reactive.Linq
         }
     }
 }
-#endif

+ 0 - 11
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Async.cs

@@ -5,12 +5,9 @@
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks;
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -661,7 +658,6 @@ namespace System.Reactive.Linq
             return ToAsync(function, scheduler)();
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> StartAsync<TSource>(Func<Task<TSource>> functionAsync)
         {
             return StartAsyncImpl(functionAsync, null);
@@ -738,7 +734,6 @@ namespace System.Reactive.Linq
                 return StableCompositeDisposable.Create(cancellable, subscription);
             });
         }
-#endif
 
         #endregion
 
@@ -754,7 +749,6 @@ namespace System.Reactive.Linq
             return ToAsync(action, scheduler)();
         }
 
-#if !NO_TPL
         public virtual IObservable<Unit> StartAsync(Func<Task> actionAsync)
         {
             return StartAsyncImpl(actionAsync, null);
@@ -831,7 +825,6 @@ namespace System.Reactive.Linq
                 return StableCompositeDisposable.Create(cancellable, subscription);
             });
         }
-#endif
 
         #endregion
 
@@ -839,8 +832,6 @@ namespace System.Reactive.Linq
 
         #region FromAsync
 
-#if !NO_TPL
-
         #region Func
 
         public virtual IObservable<TResult> FromAsync<TResult>(Func<Task<TResult>> functionAsync)
@@ -889,8 +880,6 @@ namespace System.Reactive.Linq
 
         #endregion
 
-#endif
-
         #endregion
 
         #region ToAsync

+ 2 - 2
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Blocking.cs

@@ -256,7 +256,7 @@ namespace System.Reactive.Linq
 
         public virtual IEnumerator<TSource> GetEnumerator<TSource>(IObservable<TSource> source)
         {
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
             var e = new GetEnumerator<TSource>();
             return e.Run(source);
 #else
@@ -459,7 +459,7 @@ namespace System.Reactive.Linq
 
         #region |> Helpers <|
 
-#if NO_CDS || NO_PERF
+#if NO_PERF
         private static IEnumerator<TResult> PushToPull<TSource, TResult>(IObservable<TSource> source, Action<Notification<TSource>> push, Func<Notification<TResult>> pull)
         {
             var subscription = new SingleAssignmentDisposable();

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

@@ -3,15 +3,12 @@
 // See the LICENSE file in the project root for more information. 
 
 using System.Collections.Generic;
+using System.Linq;
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
-using System.Threading;
-using System.Linq;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks;
+using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -41,7 +38,6 @@ namespace System.Reactive.Linq
 
         #region - CreateAsync -
 
-#if !NO_TPL
         public virtual IObservable<TResult> Create<TResult>(Func<IObserver<TResult>, CancellationToken, Task> subscribeAsync)
         {
             return new AnonymousObservable<TResult>(observer =>
@@ -110,7 +106,6 @@ namespace System.Reactive.Linq
         {
             return Create<TResult>((observer, token) => subscribeAsync(observer));
         }
-#endif
 
         #endregion
 
@@ -142,7 +137,6 @@ namespace System.Reactive.Linq
 
         #region + DeferAsync +
 
-#if !NO_TPL
         public virtual IObservable<TValue> Defer<TValue>(Func<Task<IObservable<TValue>>> observableFactoryAsync)
         {
             return Defer(() => StartAsync(observableFactoryAsync).Merge());
@@ -152,7 +146,6 @@ namespace System.Reactive.Linq
         {
             return Defer(() => StartAsync(observableFactoryAsync).Merge());
         }
-#endif
 
         #endregion
 
@@ -444,8 +437,6 @@ namespace System.Reactive.Linq
 
         #region - UsingAsync -
 
-#if !NO_TPL
-
         public virtual IObservable<TSource> Using<TSource, TResource>(Func<CancellationToken, Task<TResource>> resourceFactoryAsync, Func<TResource, CancellationToken, Task<IObservable<TSource>>> observableFactoryAsync) where TResource : IDisposable
         {
             return Observable.FromAsync<TResource>(resourceFactoryAsync)
@@ -457,8 +448,6 @@ namespace System.Reactive.Linq
                 );
         }
 
-#endif
-
         #endregion
     }
 }

+ 2 - 7
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Imperative.cs

@@ -7,10 +7,7 @@ using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
 using System.Threading;
-
-#if !NO_TPL
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -22,7 +19,6 @@ namespace System.Reactive.Linq
     {
         #region ForEachAsync
 
-#if !NO_TPL
         public virtual Task ForEachAsync<TSource>(IObservable<TSource> source, Action<TSource> onNext)
         {
             return ForEachAsync_(source, onNext, CancellationToken.None);
@@ -133,11 +129,10 @@ namespace System.Reactive.Linq
 
             return tcs.Task;
         }
-#endif
 
-#endregion
+        #endregion
 
-                #region + Case +
+        #region + Case +
 
         public virtual IObservable<TResult> Case<TValue, TResult>(Func<TValue> selector, IDictionary<TValue, IObservable<TResult>> sources)
         {

+ 0 - 9
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.Multiple.cs

@@ -9,11 +9,8 @@ using System.Linq;
 using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Subjects;
-
-#if !NO_TPL
 using System.Reactive.Threading.Tasks;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -713,12 +710,10 @@ namespace System.Reactive.Linq
             return Concat_<TSource>(sources);
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> Concat<TSource>(IObservable<Task<TSource>> sources)
         {
             return Concat_<TSource>(Select(sources, TaskObservableExtensions.ToObservable));
         }
-#endif
 
         private IObservable<TSource> Concat_<TSource>(IObservable<IObservable<TSource>> sources)
         {
@@ -734,7 +729,6 @@ namespace System.Reactive.Linq
             return Merge_<TSource>(sources);
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> Merge<TSource>(IObservable<Task<TSource>> sources)
         {
 #if !NO_PERF
@@ -743,7 +737,6 @@ namespace System.Reactive.Linq
             return Merge_<TSource>(Select(sources, TaskObservableExtensions.ToObservable));
 #endif
         }
-#endif
 
         public virtual IObservable<TSource> Merge<TSource>(IObservable<IObservable<TSource>> sources, int maxConcurrent)
         {
@@ -1064,12 +1057,10 @@ namespace System.Reactive.Linq
             return Switch_<TSource>(sources);
         }
 
-#if !NO_TPL
         public virtual IObservable<TSource> Switch<TSource>(IObservable<Task<TSource>> sources)
         {
             return Switch_<TSource>(Select(sources, TaskObservableExtensions.ToObservable));
         }
-#endif
 
         private IObservable<TSource> Switch_<TSource>(IObservable<IObservable<TSource>> sources)
         {

+ 0 - 8
Rx.NET/Source/src/System.Reactive/Linq/QueryLanguage.StandardSequenceOperators.cs

@@ -4,12 +4,8 @@
 
 using System.Collections.Generic;
 using System.Reactive.Concurrency;
-
-
-#if !NO_TPL
 using System.Threading;
 using System.Threading.Tasks;
-#endif
 
 namespace System.Reactive.Linq
 {
@@ -880,7 +876,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TResult>(source, selector);
         }
 
-#if !NO_TPL
         public virtual IObservable<TResult> SelectMany<TSource, TResult>(IObservable<TSource> source, Func<TSource, Task<TResult>> selector)
         {
 #if !NO_PERF
@@ -916,7 +911,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TResult>(source, (x, i) => FromAsync(ct => selector(x, i, ct)));
 #endif
         }
-#endif
 
         public virtual IObservable<TResult> SelectMany<TSource, TCollection, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TCollection>> collectionSelector, Func<TSource, TCollection, TResult> resultSelector)
         {
@@ -928,7 +922,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TCollection, TResult>(source, collectionSelector, resultSelector);
         }
 
-#if !NO_TPL
         public virtual IObservable<TResult> SelectMany<TSource, TTaskResult, TResult>(IObservable<TSource> source, Func<TSource, Task<TTaskResult>> taskSelector, Func<TSource, TTaskResult, TResult> resultSelector)
         {
 #if !NO_PERF
@@ -964,7 +957,6 @@ namespace System.Reactive.Linq
             return SelectMany_<TSource, TTaskResult, TResult>(source, (x, i) => FromAsync(ct => taskSelector(x, i, ct)), (x, i, t, _) => resultSelector(x, i, t));
 #endif
         }
-#endif
 
         private static IObservable<TResult> SelectMany_<TSource, TResult>(IObservable<TSource> source, Func<TSource, IObservable<TResult>> selector)
         {

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

@@ -10,6 +10,8 @@ using System.Reactive.Subjects;
 
 namespace System.Reactive
 {
+    // CONSIDER: Deprecate this functionality or invest in an asynchronous variant.
+
     /// <summary>
     /// Represents an object that retains the elements of the observable sequence and signals the end of the sequence.
     /// </summary>
@@ -18,15 +20,15 @@ namespace System.Reactive
     [Experimental]
     public class ListObservable<T> : IList<T>, IObservable<object>
     {
-        IDisposable subscription;
-        AsyncSubject<object> subject = new AsyncSubject<object>();
-        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.
         /// </summary>
         /// <param name="source">The observable sequence whose elements will be retained in the list.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> is <c>null</c>.</exception>
         public ListObservable(IObservable<T> source)
         {
             if (source == null)
@@ -35,7 +37,7 @@ namespace System.Reactive
             subscription = source.Subscribe(results.Add, subject.OnError, subject.OnCompleted);
         }
 
-        void Wait()
+        private void Wait()
         {
             subject.DefaultIfEmpty().Wait();
         }
@@ -48,8 +50,12 @@ namespace System.Reactive
             get
             {
                 Wait();
+
                 if (results.Count == 0)
+                {
                     throw new InvalidOperationException(Strings_Linq.NO_ELEMENTS);
+                }
+
                 return results[results.Count - 1];
             }
         }
@@ -185,17 +191,14 @@ namespace System.Reactive
             return results.GetEnumerator();
         }
 
-        IEnumerator IEnumerable.GetEnumerator()
-        {
-            return this.GetEnumerator();
-        }
+        IEnumerator IEnumerable.GetEnumerator() => GetEnumerator();
 
         /// <summary>
         /// Subscribes an observer to the ListObservable which will be notified upon completion.
         /// </summary>
         /// <param name="observer">The observer to send completion or error messages to.</param>
         /// <returns>The disposable resource that can be used to unsubscribe.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="observer"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="observer"/> is <c>null</c>.</exception>
         public IDisposable Subscribe(IObserver<object> observer)
         {
             if (observer == null)

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

@@ -7,7 +7,7 @@ namespace System.Reactive
     /// <summary>
     /// The <b>System.Reactive</b> namespace contains interfaces and classes used throughout the Reactive Extensions library.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }
@@ -20,7 +20,7 @@ namespace System.Reactive.Concurrency
     /// process event streams. Schedulers are used to parameterize the concurrency introduced by query operators, provide means to virtualize time, to process historical data,
     /// and to write unit tests for functionality built using Reactive Extensions constructs.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }
@@ -33,7 +33,7 @@ namespace System.Reactive.Disposables
     /// management in Reactive Extensions. Those types are used extensively within the implementation of Reactive Extensions and are useful when writing custom query operators or
     /// schedulers.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }
@@ -45,7 +45,7 @@ namespace System.Reactive.Linq
     /// The <b>System.Reactive.Linq</b> namespace contains interfaces and classes that support expressing queries over observable sequences, using Language Integrated Query (LINQ).
     /// Query operators are made available as extension methods for <see cref="IObservable{T}"/> and <see cref="IQbservable{T}"/> defined on the Observable and Qbservable classes, respectively.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }
@@ -58,7 +58,7 @@ namespace System.Reactive.Subjects
     /// Subjects are often used as sources of events, allowing one party to raise events and allowing another party to write queries over the event stream. Because of their ability to
     /// have multiple registered observers, subjects are also used as a facility to provide multicast behavior for event streams in queries.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }
@@ -70,7 +70,7 @@ namespace System.Reactive.PlatformServices
     /// The <b>System.Reactive.PlatformServices</b> namespace contains interfaces and classes used by the runtime infrastructure of Reactive Extensions.
     /// Those are not intended to be used directly from user code and are subject to change in future releases of the product.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }
@@ -81,7 +81,7 @@ namespace System.Reactive.Joins
     /// <summary>
     /// The <b>System.Reactive.Joins</b> namespace contains classes used to express join patterns over observable sequences using fluent method syntax.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }

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

@@ -30,7 +30,7 @@ namespace System.Reactive
         /// <summary>
         /// Represents an OnCompleted notification.
         /// </summary>
-        OnCompleted
+        OnCompleted,
     }
 
     /// <summary>
@@ -53,34 +53,22 @@ namespace System.Reactive
         /// <summary>
         /// Returns the value of an OnNext notification or throws an exception.
         /// </summary>
-        public abstract T Value
-        {
-            get;
-        }
+        public abstract T Value { get; }
 
         /// <summary>
         /// Returns a value that indicates whether the notification has a value.
         /// </summary>
-        public abstract bool HasValue
-        {
-            get;
-        }
+        public abstract bool HasValue { get; }
 
         /// <summary>
-        /// Returns the exception of an OnError notification or returns null.
+        /// Returns the exception of an OnError notification or returns <c>null</c>.
         /// </summary>
-        public abstract Exception Exception
-        {
-            get;
-        }
+        public abstract Exception Exception { get; }
 
         /// <summary>
         /// Gets the kind of notification that is represented.
         /// </summary>
-        public abstract NotificationKind Kind
-        {
-            get;
-        }
+        public abstract NotificationKind Kind { get; }
 
         /// <summary>
         /// Represents an OnNext notification to an observer.
@@ -93,65 +81,58 @@ namespace System.Reactive
 #endif
         internal sealed class OnNextNotification : Notification<T>
         {
-            T value;
-
             /// <summary>
             /// Constructs a notification of a new value.
             /// </summary>
             public OnNextNotification(T value)
             {
-                this.value = value;
+                Value = value;
             }
 
             /// <summary>
             /// Returns the value of an OnNext notification.
             /// </summary>
-            public override T Value { get { return value; } }
+            public override T Value { get; }
 
             /// <summary>
-            /// Returns null.
+            /// Returns <c>null</c>.
             /// </summary>
-            public override Exception Exception { get { return null; } }
+            public override Exception Exception => null;
 
             /// <summary>
-            /// Returns true.
+            /// Returns <c>true</c>.
             /// </summary>
-            public override bool HasValue { get { return true; } }
+            public override bool HasValue => true;
 
             /// <summary>
-            /// Returns NotificationKind.OnNext.
+            /// Returns <see cref="NotificationKind.OnNext"/>.
             /// </summary>
-            public override NotificationKind Kind { get { return NotificationKind.OnNext; } }
+            public override NotificationKind Kind => NotificationKind.OnNext;
 
             /// <summary>
             /// Returns the hash code for this instance.
             /// </summary>
-            public override int GetHashCode()
-            {
-                return EqualityComparer<T>.Default.GetHashCode(Value);
-            }
+            public override int GetHashCode() => EqualityComparer<T>.Default.GetHashCode(Value);
 
             /// <summary>
             /// Indicates whether this instance and a specified object are equal.
             /// </summary>
             public override bool Equals(Notification<T> other)
             {
-                if (Object.ReferenceEquals(this, other))
+                if (ReferenceEquals(this, other))
                     return true;
-                if (Object.ReferenceEquals(other, null))
+                if (ReferenceEquals(other, null))
                     return false;
                 if (other.Kind != NotificationKind.OnNext)
                     return false;
+
                 return EqualityComparer<T>.Default.Equals(Value, other.Value);
             }
 
             /// <summary>
             /// Returns a string representation of this instance.
             /// </summary>
-            public override string ToString()
-            {
-                return 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.
@@ -227,65 +208,58 @@ namespace System.Reactive
 #endif
         internal sealed class OnErrorNotification : Notification<T>
         {
-            Exception exception;
-
             /// <summary>
             /// Constructs a notification of an exception.
             /// </summary>
             public OnErrorNotification(Exception exception)
             {
-                this.exception = exception;
+                Exception = exception;
             }
 
             /// <summary>
             /// Throws the exception.
             /// </summary>
-            public override T Value { get { exception.Throw(); return default(T); } }
+            public override T Value { get { Exception.Throw(); return default(T); } }
 
             /// <summary>
             /// Returns the exception.
             /// </summary>
-            public override Exception Exception { get { return exception; } }
+            public override Exception Exception { get; }
 
             /// <summary>
-            /// Returns false.
+            /// Returns <c>false</c>.
             /// </summary>
-            public override bool HasValue { get { return false; } }
+            public override bool HasValue => false;
 
             /// <summary>
-            /// Returns NotificationKind.OnError.
+            /// Returns <see cref="NotificationKind.OnError"/>.
             /// </summary>
-            public override NotificationKind Kind { get { return NotificationKind.OnError; } }
+            public override NotificationKind Kind => NotificationKind.OnError;
 
             /// <summary>
             /// Returns the hash code for this instance.
             /// </summary>
-            public override int GetHashCode()
-            {
-                return Exception.GetHashCode();
-            }
+            public override int GetHashCode() => Exception.GetHashCode();
 
             /// <summary>
             /// Indicates whether this instance and other are equal.
             /// </summary>
             public override bool Equals(Notification<T> other)
             {
-                if (Object.ReferenceEquals(this, other))
+                if (ReferenceEquals(this, other))
                     return true;
-                if (Object.ReferenceEquals(other, null))
+                if (ReferenceEquals(other, null))
                     return false;
                 if (other.Kind != NotificationKind.OnError)
                     return false;
-                return Object.Equals(Exception, other.Exception);
+
+                return Equals(Exception, other.Exception);
             }
 
             /// <summary>
             /// Returns a string representation of this instance.
             /// </summary>
-            public override string ToString()
-            {
-                return 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.
@@ -369,52 +343,47 @@ namespace System.Reactive
             }
 
             /// <summary>
-            /// Throws an InvalidOperationException.
+            /// Throws an <see cref="InvalidOperationException"/>.
             /// </summary>
             public override T Value { get { throw new InvalidOperationException(Strings_Core.COMPLETED_NO_VALUE); } }
 
             /// <summary>
-            /// Returns null.
+            /// Returns <c>null</c>.
             /// </summary>
-            public override Exception Exception { get { return null; } }
+            public override Exception Exception => null;
 
             /// <summary>
-            /// Returns false.
+            /// Returns <c>false</c>.
             /// </summary>
-            public override bool HasValue { get { return false; } }
+            public override bool HasValue => false;
 
             /// <summary>
-            /// Returns NotificationKind.OnCompleted.
+            /// Returns <see cref="NotificationKind.OnCompleted"/>.
             /// </summary>
-            public override NotificationKind Kind { get { return NotificationKind.OnCompleted; } }
+            public override NotificationKind Kind => NotificationKind.OnCompleted;
 
             /// <summary>
             /// Returns the hash code for this instance.
             /// </summary>
-            public override int GetHashCode()
-            {
-                return typeof(T).GetHashCode() ^ 8510;
-            }
+            public override int GetHashCode() => typeof(T).GetHashCode() ^ 8510;
 
             /// <summary>
             /// Indicates whether this instance and other are equal.
             /// </summary>
             public override bool Equals(Notification<T> other)
             {
-                if (Object.ReferenceEquals(this, other))
+                if (ReferenceEquals(this, other))
                     return true;
-                if (Object.ReferenceEquals(other, null))
+                if (ReferenceEquals(other, null))
                     return false;
+
                 return other.Kind == NotificationKind.OnCompleted;
             }
 
             /// <summary>
             /// Returns a string representation of this instance.
             /// </summary>
-            public override string ToString()
-            {
-                return "OnCompleted()";
-            }
+            public override string ToString() => "OnCompleted()";
 
             /// <summary>
             /// Invokes the observer's method corresponding to the notification.
@@ -483,7 +452,7 @@ namespace System.Reactive
         /// Determines whether the current <see cref="Notification{T}"/> object has the same observer message payload as a specified <see cref="Notification{T}"/> value.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="Notification{T}"/> object.</param>
-        /// <returns>true if both <see cref="Notification{T}"/> objects have the same observer message payload; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="Notification{T}"/> objects have the same observer message payload; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
@@ -494,9 +463,9 @@ namespace System.Reactive
         /// <summary>
         /// Determines whether the two specified <see cref="Notification{T}"/> objects have the same observer message payload.
         /// </summary>
-        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <returns>true if the first <see cref="Notification{T}"/> value has the same observer message payload as the second <see cref="Notification{T}"/> value; otherwise, false.</returns>
+        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <returns><c>true</c> if the first <see cref="Notification{T}"/> value has the same observer message payload as the second <see cref="Notification{T}"/> value; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
@@ -504,7 +473,7 @@ namespace System.Reactive
         /// </remarks>
         public static bool operator ==(Notification<T> left, Notification<T> right)
         {
-            if (object.ReferenceEquals(left, right))
+            if (ReferenceEquals(left, right))
                 return true;
 
             if ((object)left == null || (object)right == null)
@@ -516,33 +485,27 @@ namespace System.Reactive
         /// <summary>
         /// Determines whether the two specified <see cref="Notification{T}"/> objects have a different observer message payload.
         /// </summary>
-        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <returns>true if the first <see cref="Notification{T}"/> value has a different observer message payload as the second <see cref="Notification{T}"/> value; otherwise, false.</returns>
+        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <returns><c>true</c> if the first <see cref="Notification{T}"/> value has a different observer message payload as the second <see cref="Notification{T}"/> value; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
         /// In case one wants to determine whether two <see cref="Notification{T}"/> objects represent a different observer method call, use Object.ReferenceEquals identity equality instead.
         /// </remarks>
-        public static bool operator !=(Notification<T> left, Notification<T> right)
-        {
-            return !(left == right);
-        }
+        public static bool operator !=(Notification<T> left, Notification<T> right) => !(left == right);
 
         /// <summary>
         /// Determines whether the specified System.Object is equal to the current <see cref="Notification{T}"/>.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="Notification{T}"/>.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="Notification{T}"/>; otherwise, false.</returns>
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="Notification{T}"/>; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
         /// In case one wants to determine whether two <see cref="Notification{T}"/> objects represent the same observer method call, use Object.ReferenceEquals identity equality instead.
         /// </remarks>
-        public override bool Equals(object obj)
-        {
-            return Equals(obj as Notification<T>);
-        }
+        public override bool Equals(object obj) => Equals(obj as Notification<T>);
 
         /// <summary>
         /// Invokes the observer's method corresponding to the notification.
@@ -580,10 +543,7 @@ namespace System.Reactive
         /// Returns an observable sequence with a single notification, using the immediate scheduler.
         /// </summary>
         /// <returns>The observable sequence that surfaces the behavior of the notification upon subscription.</returns>
-        public IObservable<T> ToObservable()
-        {
-            return this.ToObservable(ImmediateScheduler.Instance);
-        }
+        public IObservable<T> ToObservable() => ToObservable(ImmediateScheduler.Instance);
 
         /// <summary>
         /// Returns an observable sequence with a single notification.
@@ -597,9 +557,12 @@ namespace System.Reactive
 
             return new AnonymousObservable<T>(observer => scheduler.Schedule(() =>
             {
-                this.Accept(observer);
-                if (this.Kind == NotificationKind.OnNext)
+                Accept(observer);
+
+                if (Kind == NotificationKind.OnNext)
+                {
                     observer.OnCompleted();
+                }
             }));
         }
     }
@@ -648,4 +611,4 @@ namespace System.Reactive
 }
 
 #pragma warning restore 0659
-#pragma warning restore 0661
+#pragma warning restore 0661

+ 34 - 28
Rx.NET/Source/src/System.Reactive/Observable.Extensions.cs

@@ -22,8 +22,8 @@ namespace System
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
-        /// <returns>IDisposable object used to unsubscribe from the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
+        /// <returns><see cref="IDisposable"/> object used to unsubscribe from the observable sequence.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> is <c>null</c>.</exception>
         public static IDisposable Subscribe<T>(this IObservable<T> source)
         {
             if (source == null)
@@ -41,8 +41,8 @@ namespace System
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
-        /// <returns>IDisposable object used to unsubscribe from the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> is null.</exception>
+        /// <returns><see cref="IDisposable"/> object used to unsubscribe from the observable sequence.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> is <c>null</c>.</exception>
         public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext)
         {
             if (source == null)
@@ -63,8 +63,8 @@ namespace System
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
         /// <param name="onError">Action to invoke upon exceptional termination of the observable sequence.</param>
-        /// <returns>IDisposable object used to unsubscribe from the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> is null.</exception>
+        /// <returns><see cref="IDisposable"/> object used to unsubscribe from the observable sequence.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> is <c>null</c>.</exception>
         public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError)
         {
             if (source == null)
@@ -87,8 +87,8 @@ namespace System
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
         /// <param name="onCompleted">Action to invoke upon graceful termination of the observable sequence.</param>
-        /// <returns>IDisposable object used to unsubscribe from the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onCompleted"/> is null.</exception>
+        /// <returns><see cref="IDisposable"/> object used to unsubscribe from the observable sequence.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onCompleted"/> is <c>null</c>.</exception>
         public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action onCompleted)
         {
             if (source == null)
@@ -112,8 +112,8 @@ namespace System
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
         /// <param name="onError">Action to invoke upon exceptional termination of the observable sequence.</param>
         /// <param name="onCompleted">Action to invoke upon graceful termination of the observable sequence.</param>
-        /// <returns>IDisposable object used to unsubscribe from the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is null.</exception>
+        /// <returns><see cref="IDisposable"/> object used to unsubscribe from the observable sequence.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is <c>null</c>.</exception>
         public static IDisposable Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted)
         {
             if (source == null)
@@ -135,15 +135,14 @@ namespace System
 
         #region Subscribe overloads with CancellationToken
 
-#if !NO_TPL
         /// <summary>
-        /// Subscribes an observer to an observable sequence, using a CancellationToken to support unsubscription.
+        /// Subscribes an observer to an observable sequence, using a <see cref="CancellationToken"/> to support unsubscription.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="observer">Observer to subscribe to the sequence.</param>
         /// <param name="token">CancellationToken that can be signaled to unsubscribe from the source sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="observer"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="observer"/> is <c>null</c>.</exception>
         public static void Subscribe<T>(this IObservable<T> source, IObserver<T> observer, CancellationToken token)
         {
             if (source == null)
@@ -155,13 +154,13 @@ namespace System
         }
 
         /// <summary>
-        /// Subscribes to the observable sequence without specifying any handlers, using a CancellationToken to support unsubscription.
+        /// Subscribes to the observable sequence without specifying any handlers, using a <see cref="CancellationToken"/> to support unsubscription.
         /// This method can be used to evaluate the observable sequence for its side-effects only.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="token">CancellationToken that can be signaled to unsubscribe from the source sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> is <c>null</c>.</exception>
         public static void Subscribe<T>(this IObservable<T> source, CancellationToken token)
         {
             if (source == null)
@@ -171,13 +170,13 @@ namespace System
         }
 
         /// <summary>
-        /// Subscribes an element handler to an observable sequence, using a CancellationToken to support unsubscription.
+        /// Subscribes an element handler to an observable sequence, using a <see cref="CancellationToken"/> to support unsubscription.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
         /// <param name="token">CancellationToken that can be signaled to unsubscribe from the source sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> is <c>null</c>.</exception>
         public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, CancellationToken token)
         {
             if (source == null)
@@ -189,14 +188,14 @@ namespace System
         }
 
         /// <summary>
-        /// Subscribes an element handler and an exception handler to an observable sequence, using a CancellationToken to support unsubscription.
+        /// Subscribes an element handler and an exception handler to an observable sequence, using a <see cref="CancellationToken"/> to support unsubscription.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
         /// <param name="onError">Action to invoke upon exceptional termination of the observable sequence.</param>
         /// <param name="token">CancellationToken that can be signaled to unsubscribe from the source sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> is <c>null</c>.</exception>
         public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, CancellationToken token)
         {
             if (source == null)
@@ -210,14 +209,14 @@ namespace System
         }
 
         /// <summary>
-        /// Subscribes an element handler and a completion handler to an observable sequence, using a CancellationToken to support unsubscription.
+        /// Subscribes an element handler and a completion handler to an observable sequence, using a <see cref="CancellationToken"/> to support unsubscription.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="onNext">Action to invoke for each element in the observable sequence.</param>
         /// <param name="onCompleted">Action to invoke upon graceful termination of the observable sequence.</param>
         /// <param name="token">CancellationToken that can be signaled to unsubscribe from the source sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onCompleted"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onCompleted"/> is <c>null</c>.</exception>
         public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action onCompleted, CancellationToken token)
         {
             if (source == null)
@@ -231,7 +230,7 @@ namespace System
         }
 
         /// <summary>
-        /// Subscribes an element handler, an exception handler, and a completion handler to an observable sequence, using a CancellationToken to support unsubscription.
+        /// Subscribes an element handler, an exception handler, and a completion handler to an observable sequence, using a <see cref="CancellationToken"/> to support unsubscription.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
@@ -239,7 +238,7 @@ namespace System
         /// <param name="onError">Action to invoke upon exceptional termination of the observable sequence.</param>
         /// <param name="onCompleted">Action to invoke upon graceful termination of the observable sequence.</param>
         /// <param name="token">CancellationToken that can be signaled to unsubscribe from the source sequence.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> or <paramref name="onError"/> or <paramref name="onCompleted"/> is <c>null</c>.</exception>
         public static void Subscribe<T>(this IObservable<T> source, Action<T> onNext, Action<Exception> onError, Action onCompleted, CancellationToken token)
         {
             if (source == null)
@@ -270,12 +269,16 @@ namespace System
                         ex =>
                         {
                             using (r)
+                            {
                                 observer.OnError(ex);
+                            }
                         },
                         () =>
                         {
                             using (r)
+                            {
                                 observer.OnCompleted();
+                            }
                         }
                     );
 
@@ -287,21 +290,20 @@ namespace System
                 source.Subscribe(observer);
             }
         }
-#endif
 
         #endregion
 
         #region SubscribeSafe
 
         /// <summary>
-        /// Subscribes to the specified source, re-routing synchronous exceptions during invocation of the Subscribe method to the observer's OnError channel.
+        /// Subscribes to the specified source, re-routing synchronous exceptions during invocation of the <see cref="IObservable{T}.Subscribe(IObserver{T})"/> method to the observer's <see cref="IObserver{T}.OnError(Exception)"/> channel.
         /// This method is typically used when writing query operators.
         /// </summary>
         /// <typeparam name="T">The type of the elements in the source sequence.</typeparam>
         /// <param name="source">Observable sequence to subscribe to.</param>
         /// <param name="observer">Observer that will be passed to the observable sequence, and that will be used for exception propagation.</param>
-        /// <returns>IDisposable object used to unsubscribe from the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="observer"/> is null.</exception>
+        /// <returns><see cref="IDisposable"/> object used to unsubscribe from the observable sequence.</returns>
+        /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="observer"/> is <c>null</c>.</exception>
         [EditorBrowsable(EditorBrowsableState.Advanced)]
         public static IDisposable SubscribeSafe<T>(this IObservable<T> source, IObserver<T> observer)
         {
@@ -315,12 +317,16 @@ namespace System
             // for regular operation circumstances.
             //
             if (source is ObservableBase<T>)
+            {
                 return source.Subscribe(observer);
+            }
 
 #if !NO_PERF
             var producer = source as IProducer<T>;
             if (producer != null)
-                return producer.SubscribeRaw(observer, false);
+            {
+                return producer.SubscribeRaw(observer, enableSafeguard: false);
+            }
 #endif
 
             var d = Disposable.Empty;

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

@@ -23,14 +23,14 @@ namespace System.Reactive
         /// </summary>
         /// <param name="observer">Observer that will receive notifications from the observable sequence.</param>
         /// <returns>Disposable object representing an observer's subscription to the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="observer"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="observer"/> is <c>null</c>.</exception>
         public IDisposable Subscribe(IObserver<T> observer)
         {
             if (observer == null)
                 throw new ArgumentNullException(nameof(observer));
 
             var autoDetachObserver = new AutoDetachObserver<T>(observer);
-            
+
             if (CurrentThreadScheduler.IsScheduleRequired)
             {
                 //

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

@@ -121,15 +121,9 @@ namespace System.Reactive
             _expression = expression;
         }
 
-        public Type ElementType
-        {
-            get { return typeof(TSource); }
-        }
+        public Type ElementType => typeof(TSource);
 
-        public IQbservableProvider Provider
-        {
-            get { return Qbservable.Provider; }
-        }
+        public IQbservableProvider Provider => Qbservable.Provider;
 
         public IDisposable Subscribe(IObserver<TSource> observer)
         {

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

@@ -9,7 +9,7 @@ namespace System.Reactive
     /// <summary>
     /// Abstract base class for implementations of the <see cref="IObserver{T}"/> interface.
     /// </summary>
-    /// <remarks>This base class enforces the grammar of observers where OnError and OnCompleted are terminal messages.</remarks>
+    /// <remarks>This base class enforces the grammar of observers where <see cref="IObserver{T}.OnError(Exception)"/> and <see cref="IObserver{T}.OnCompleted()"/> are terminal messages.</remarks>
     /// <typeparam name="T">The type of the elements in the sequence.</typeparam>
     public abstract class ObserverBase<T> : IObserver<T>, IDisposable
     {
@@ -30,7 +30,9 @@ namespace System.Reactive
         public void OnNext(T value)
         {
             if (Volatile.Read(ref isStopped) == 0)
+            {
                 OnNextCore(value);
+            }
         }
 
         /// <summary>
@@ -44,7 +46,7 @@ namespace System.Reactive
         /// Notifies the observer that an exception has occurred.
         /// </summary>
         /// <param name="error">The error that has occurred.</param>
-        /// <exception cref="ArgumentNullException"><paramref name="error"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="error"/> is <c>null</c>.</exception>
         public void OnError(Exception error)
         {
             if (error == null)
@@ -91,9 +93,9 @@ namespace System.Reactive
         }
 
         /// <summary>
-        /// Core implementation of IDisposable.
+        /// Core implementation of <see cref="IDisposable"/>.
         /// </summary>
-        /// <param name="disposing">true if the Dispose call was triggered by the IDisposable.Dispose method; false if it was triggered by the finalizer.</param>
+        /// <param name="disposing"><c>true</c> if the Dispose call was triggered by the <see cref="IDisposable.Dispose"/> method; <c>false</c> if it was triggered by the finalizer.</param>
         protected virtual void Dispose(bool disposing)
         {
             if (disposing)

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

@@ -270,10 +270,7 @@ namespace System.Reactive.Subjects
         /// Gets an awaitable object for the current AsyncSubject.
         /// </summary>
         /// <returns>Object that can be awaited.</returns>
-        public AsyncSubject<T> GetAwaiter()
-        {
-            return this;
-        }
+        public AsyncSubject<T> GetAwaiter() => this;
 
         /// <summary>
         /// Specifies a callback action that will be invoked when the subject completes.
@@ -346,13 +343,7 @@ namespace System.Reactive.Subjects
         /// <summary>
         /// Gets whether the AsyncSubject has completed.
         /// </summary>
-        public bool IsCompleted
-        {
-            get
-            {
-                return _isStopped;
-            }
-        }
+        public bool IsCompleted => _isStopped;
 
         /// <summary>
         /// Gets the last element of the subject, potentially blocking until the subject completes successfully or exceptionally.

+ 1 - 7
Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs

@@ -49,13 +49,7 @@ namespace System.Reactive.Subjects
         /// <summary>
         /// Indicates whether the subject has been disposed.
         /// </summary>
-        public override bool IsDisposed
-        {
-            get
-            {
-                return _observer is DisposedObserver<T>;
-            }
-        }
+        public override bool IsDisposed => _observer is DisposedObserver<T>;
 
         #endregion
 

+ 1 - 1
Rx.NET/Source/src/System.Reactive/Threading/Tasks/NamespaceDoc.cs

@@ -7,7 +7,7 @@ namespace System.Reactive.Threading.Tasks
     /// <summary>
     /// The <b>System.Reactive.Threading.Tasks</b> namespace contains helpers for the conversion between tasks and observable sequences.
     /// </summary>
-    [System.Runtime.CompilerServices.CompilerGeneratedAttribute]
+    [System.Runtime.CompilerServices.CompilerGenerated]
     class NamespaceDoc
     {
     }

+ 36 - 34
Rx.NET/Source/src/System.Reactive/Threading/Tasks/TaskObservableExtensions.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. 
 
-#if !NO_TPL
 using System.Reactive.Disposables;
 using System.Threading.Tasks;
 using System.Threading;
@@ -23,14 +22,14 @@ namespace System.Reactive.Threading.Tasks
         /// </summary>
         /// <param name="task">Task to convert to an observable sequence.</param>
         /// <returns>An observable sequence that produces a unit value when the task completes, or propagates the exception produced by the task.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="task"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="task"/> is <c>null</c>.</exception>
         /// <remarks>If the specified task object supports cancellation, consider using <see cref="Observable.FromAsync(Func{CancellationToken, Task})"/> instead.</remarks>
         public static IObservable<Unit> ToObservable(this Task task)
         {
             if (task == null)
                 throw new ArgumentNullException(nameof(task));
 
-            return ToObservableImpl(task, null);
+            return ToObservableImpl(task, scheduler: null);
         }
 
         /// <summary>
@@ -39,7 +38,7 @@ namespace System.Reactive.Threading.Tasks
         /// <param name="task">Task to convert to an observable sequence.</param>
         /// <param name="scheduler">Scheduler on which to notify observers about completion, cancellation or failure.</param>
         /// <returns>An observable sequence that produces a unit value when the task completes, or propagates the exception produced by the task.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="task"/> is null or <paramref name="scheduler"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="task"/> is <c>null</c> or <paramref name="scheduler"/> is <c>null</c>.</exception>
         /// <remarks>If the specified task object supports cancellation, consider using <see cref="Observable.FromAsync(Func{CancellationToken, Task})"/> instead.</remarks>
         public static IObservable<Unit> ToObservable(this Task task, IScheduler scheduler)
         {
@@ -117,14 +116,14 @@ namespace System.Reactive.Threading.Tasks
         /// <typeparam name="TResult">The type of the result produced by the task.</typeparam>
         /// <param name="task">Task to convert to an observable sequence.</param>
         /// <returns>An observable sequence that produces the task's result, or propagates the exception produced by the task.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="task"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="task"/> is <c>null</c>.</exception>
         /// <remarks>If the specified task object supports cancellation, consider using <see cref="Observable.FromAsync{TResult}(Func{CancellationToken, Task{TResult}})"/> instead.</remarks>
         public static IObservable<TResult> ToObservable<TResult>(this Task<TResult> task)
         {
             if (task == null)
                 throw new ArgumentNullException(nameof(task));
 
-            return ToObservableImpl(task, null);
+            return ToObservableImpl(task, scheduler: null);
         }
 
         /// <summary>
@@ -134,7 +133,7 @@ namespace System.Reactive.Threading.Tasks
         /// <param name="task">Task to convert to an observable sequence.</param>
         /// <param name="scheduler">Scheduler on which to notify observers about completion, cancellation or failure.</param>
         /// <returns>An observable sequence that produces the task's result, or propagates the exception produced by the task.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="task"/> is null or <paramref name="scheduler"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="task"/> is <c>null</c> or <paramref name="scheduler"/> is <c>null</c>.</exception>
         /// <remarks>If the specified task object supports cancellation, consider using <see cref="Observable.FromAsync{TResult}(Func{CancellationToken, Task{TResult}})"/> instead.</remarks>
         public static IObservable<TResult> ToObservable<TResult>(this Task<TResult> task, IScheduler scheduler)
         {
@@ -246,13 +245,13 @@ namespace System.Reactive.Threading.Tasks
         /// <typeparam name="TResult">The type of the elements in the source sequence.</typeparam>
         /// <param name="observable">Observable sequence to convert to a task.</param>
         /// <returns>A task that will receive the last element or the exception produced by the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is <c>null</c>.</exception>
         public static Task<TResult> ToTask<TResult>(this IObservable<TResult> observable)
         {
             if (observable == null)
                 throw new ArgumentNullException(nameof(observable));
 
-            return observable.ToTask(new CancellationToken(), null);
+            return observable.ToTask(new CancellationToken(), state: null);
         }
 
         /// <summary>
@@ -262,7 +261,7 @@ namespace System.Reactive.Threading.Tasks
         /// <param name="observable">Observable sequence to convert to a task.</param>
         /// <param name="state">The state to use as the underlying task's AsyncState.</param>
         /// <returns>A task that will receive the last element or the exception produced by the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is <c>null</c>.</exception>
         public static Task<TResult> ToTask<TResult>(this IObservable<TResult> observable, object state)
         {
             if (observable == null)
@@ -278,13 +277,13 @@ namespace System.Reactive.Threading.Tasks
         /// <param name="observable">Observable sequence to convert to a task.</param>
         /// <param name="cancellationToken">Cancellation token that can be used to cancel the task, causing unsubscription from the observable sequence.</param>
         /// <returns>A task that will receive the last element or the exception produced by the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is <c>null</c>.</exception>
         public static Task<TResult> ToTask<TResult>(this IObservable<TResult> observable, CancellationToken cancellationToken)
         {
             if (observable == null)
                 throw new ArgumentNullException(nameof(observable));
 
-            return observable.ToTask(cancellationToken, null);
+            return observable.ToTask(cancellationToken, state: null);
         }
 
         private sealed class ToTaskObserver<TResult> : IObserver<TResult>
@@ -299,48 +298,52 @@ namespace System.Reactive.Threading.Tasks
 
             public ToTaskObserver(TaskCompletionSource<TResult> tcs, IDisposable disposable, CancellationToken ct)
             {
-                this._ct = ct;
-                this._tcs = tcs;
-                this._disposable = disposable;
+                _ct = ct;
+                _tcs = tcs;
+                _disposable = disposable;
 
                 if (ct.CanBeCanceled)
                 {
-                    this._ctr = ct.Register(this.Cancel);
+                    _ctr = ct.Register(Cancel);
                 }
             }
 
             public void OnNext(TResult value)
             {
-                this._hasValue = true;
-                this._lastValue = value;
+                _hasValue = true;
+                _lastValue = value;
             }
 
             public void OnError(Exception error)
             {
-                this._tcs.TrySetException(error);
+                _tcs.TrySetException(error);
 
-                this._ctr.Dispose(); // no null-check needed (struct)
-                this._disposable.Dispose();
+                _ctr.Dispose(); // no null-check needed (struct)
+                _disposable.Dispose();
             }
 
             public void OnCompleted()
             {
-                if (this._hasValue)
-                    this._tcs.TrySetResult(this._lastValue);
+                if (_hasValue)
+                {
+                    _tcs.TrySetResult(_lastValue);
+                }
                 else
-                    this._tcs.TrySetException(new InvalidOperationException(Strings_Linq.NO_ELEMENTS));
+                {
+                    _tcs.TrySetException(new InvalidOperationException(Strings_Linq.NO_ELEMENTS));
+                }
 
-                this._ctr.Dispose(); // no null-check needed (struct)
-                this._disposable.Dispose();
+                _ctr.Dispose(); // no null-check needed (struct)
+                _disposable.Dispose();
             }
 
             private void Cancel()
             {
-                this._disposable.Dispose();
+                _disposable.Dispose();
 #if HAS_TPL46
-                this._tcs.TrySetCanceled(this._ct);
+                _tcs.TrySetCanceled(_ct);
 #else
-                this._tcs.TrySetCanceled();
+                _tcs.TrySetCanceled();
 #endif
             }
         }
@@ -351,9 +354,9 @@ namespace System.Reactive.Threading.Tasks
         /// <typeparam name="TResult">The type of the elements in the source sequence.</typeparam>
         /// <param name="observable">Observable sequence to convert to a task.</param>
         /// <param name="cancellationToken">Cancellation token that can be used to cancel the task, causing unsubscription from the observable sequence.</param>
-        /// <param name="state">The state to use as the underlying task's AsyncState.</param>
+        /// <param name="state">The state to use as the underlying task's <see cref="Task.AsyncState"/>.</param>
         /// <returns>A task that will receive the last element or the exception produced by the observable sequence.</returns>
-        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is null.</exception>
+        /// <exception cref="ArgumentNullException"><paramref name="observable"/> is <c>null</c>.</exception>
         public static Task<TResult> ToTask<TResult>(this IObservable<TResult> observable, CancellationToken cancellationToken, object state)
         {
             if (observable == null)
@@ -364,11 +367,11 @@ namespace System.Reactive.Threading.Tasks
             var disposable = new SingleAssignmentDisposable();
 
             var taskCompletionObserver = new ToTaskObserver<TResult>(tcs, disposable, cancellationToken);
-            
+
             //
             // Subtle race condition: if the source completes before we reach the line below, the SingleAssigmentDisposable
             // will already have been disposed. Upon assignment, the disposable resource being set will be disposed on the
-            // spot, which may throw an exception. (Similar to TFS 487142)
+            // spot, which may throw an exception.
             //
             try
             {
@@ -390,4 +393,3 @@ namespace System.Reactive.Threading.Tasks
         }
     }
 }
-#endif

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

@@ -17,9 +17,6 @@ namespace System.Reactive
 #endif
     public struct TimeInterval<T> : IEquatable<TimeInterval<T>>
     {
-        private readonly TimeSpan _interval;
-        private readonly T _value;
-
         /// <summary>
         /// Constructs a time interval value.
         /// </summary>
@@ -27,53 +24,47 @@ namespace System.Reactive
         /// <param name="interval">Time interval associated with the value.</param>
         public TimeInterval(T value, TimeSpan interval)
         {
-            _interval = interval;
-            _value = value;
+            Interval = interval;
+            Value = value;
         }
 
         /// <summary>
         /// Gets the value.
         /// </summary>
-        public T Value
-        {
-            get { return _value; }
-        }
+        public T Value { get; }
 
         /// <summary>
         /// Gets the interval.
         /// </summary>
-        public TimeSpan Interval
-        {
-            get { return _interval; }
-        }
+        public TimeSpan Interval { get; }
 
         /// <summary>
-        /// Determines whether the current <see cref="TimeInterval{T}"/> value has the same Value and Interval as a specified <see cref="TimeInterval{T}"/> value.
+        /// Determines whether the current <see cref="TimeInterval{T}"/> value has the same <see cref="Value"/> and <see cref="Interval"/> as a specified <see cref="TimeInterval{T}"/> value.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="TimeInterval{T}"/> value.</param>
-        /// <returns>true if both <see cref="TimeInterval{T}"/> values have the same Value and Interval; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="TimeInterval{T}"/> values have the same <see cref="Value"/> and <see cref="Interval"/>; otherwise, <c>false</c>.</returns>
         public bool Equals(TimeInterval<T> other)
         {
             return other.Interval.Equals(Interval) && EqualityComparer<T>.Default.Equals(Value, other.Value);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values have the same Value and Interval.
+        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values have the same <see cref="Value"/> and <see cref="Interval"/>.
         /// </summary>
         /// <param name="first">The first <see cref="TimeInterval{T}"/> value to compare.</param>
         /// <param name="second">The second <see cref="TimeInterval{T}"/> value to compare.</param>
-        /// <returns>true if the first <see cref="TimeInterval{T}"/> value has the same Value and Interval as the second <see cref="TimeInterval{T}"/> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="TimeInterval{T}"/> value has the same <see cref="Value"/> and <see cref="Interval"/> as the second <see cref="TimeInterval{T}"/> value; otherwise, <c>false</c>.</returns>
         public static bool operator ==(TimeInterval<T> first, TimeInterval<T> second)
         {
             return first.Equals(second);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values don't have the same Value and Interval.
+        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values don't have the same <see cref="Value"/> and <see cref="Interval"/>.
         /// </summary>
         /// <param name="first">The first <see cref="TimeInterval{T}"/> value to compare.</param>
         /// <param name="second">The second <see cref="TimeInterval{T}"/> value to compare.</param>
-        /// <returns>true if the first <see cref="TimeInterval{T}"/> value has a different Value or Interval as the second <see cref="TimeInterval{T}"/> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="TimeInterval{T}"/> value has a different <see cref="Value"/> or <see cref="Interval"/> as the second <see cref="TimeInterval{T}"/> value; otherwise, <c>false</c>.</returns>
         public static bool operator !=(TimeInterval<T> first, TimeInterval<T> second)
         {
             return !first.Equals(second);
@@ -83,7 +74,7 @@ namespace System.Reactive
         /// Determines whether the specified System.Object is equal to the current <see cref="TimeInterval{T}"/>.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="TimeInterval{T}"/>.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="TimeInterval{T}"/>; otherwise, false.</returns>
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="TimeInterval{T}"/>; otherwise, <c>false</c>.</returns>
         public override bool Equals(object obj)
         {
             if (!(obj is TimeInterval<T>))
@@ -99,9 +90,7 @@ namespace System.Reactive
         /// <returns>A hash code for the current <see cref="TimeInterval{T}"/> value.</returns>
         public override int GetHashCode()
         {
-            var valueHashCode = Value == null ? 1963 : Value.GetHashCode();
-
-            return Interval.GetHashCode() ^ valueHashCode;
+            return Interval.GetHashCode() ^ (Value?.GetHashCode() ?? 1963);
         }
 
         /// <summary>

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

@@ -18,9 +18,6 @@ namespace System.Reactive
     [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Timestamped", Justification = "Reviewed and agreed upon.")]
     public struct Timestamped<T> : IEquatable<Timestamped<T>>
     {
-        private readonly DateTimeOffset _timestamp;
-        private readonly T _value;
-
         /// <summary>
         /// Constructs a timestamped value.
         /// </summary>
@@ -28,53 +25,47 @@ namespace System.Reactive
         /// <param name="timestamp">Timestamp associated with the value.</param>
         public Timestamped(T value, DateTimeOffset timestamp)
         {
-            _timestamp = timestamp;
-            _value = value;
+            Timestamp = timestamp;
+            Value = value;
         }
 
         /// <summary>
         /// Gets the value.
         /// </summary>
-        public T Value
-        {
-            get { return _value; }
-        }
+        public T Value { get; }
 
         /// <summary>
         /// Gets the timestamp.
         /// </summary>
-        public DateTimeOffset Timestamp
-        {
-            get { return _timestamp; }
-        }
+        public DateTimeOffset Timestamp { get; }
 
         /// <summary>
-        /// Determines whether the current <see cref="Timestamped{T}" /> value has the same Value and Timestamp as a specified <see cref="Timestamped{T}" /> value.
+        /// Determines whether the current <see cref="Timestamped{T}" /> value has the same <see cref="Value"/> and <see cref="Timestamp"/> as a specified <see cref="Timestamped{T}" /> value.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="Timestamped{T}" /> value.</param>
-        /// <returns>true if both <see cref="Timestamped{T}" /> values have the same Value and Timestamp; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="Timestamped{T}" /> values have the same <see cref="Value"/> and <see cref="Timestamp"/>; otherwise, <c>false</c>.</returns>
         public bool Equals(Timestamped<T> other)
         {
             return other.Timestamp.Equals(Timestamp) && EqualityComparer<T>.Default.Equals(Value, other.Value);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="Timestamped{T}" /> values have the same Value and Timestamp.
+        /// Determines whether the two specified <see cref="Timestamped{T}" /> values have the same <see cref="Value"/> and <see cref="Timestamp"/>.
         /// </summary>
         /// <param name="first">The first <see cref="Timestamped{T}" /> value to compare.</param>
         /// <param name="second">The second <see cref="Timestamped{T}" /> value to compare.</param>
-        /// <returns>true if the first <see cref="Timestamped{T}" /> value has the same Value and Timestamp as the second <see cref="Timestamped{T}" /> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="Timestamped{T}" /> value has the same <see cref="Value"/> and <see cref="Timestamp"/> as the second <see cref="Timestamped{T}" /> value; otherwise, <c>false</c>.</returns>
         public static bool operator ==(Timestamped<T> first, Timestamped<T> second)
         {
             return first.Equals(second);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="Timestamped{T}" /> values don't have the same Value and Timestamp.
+        /// Determines whether the two specified <see cref="Timestamped{T}" /> values don't have the same <see cref="Value"/> and <see cref="Timestamp"/>.
         /// </summary>
         /// <param name="first">The first <see cref="Timestamped{T}" /> value to compare.</param>
         /// <param name="second">The second <see cref="Timestamped{T}" /> value to compare.</param>
-        /// <returns>true if the first <see cref="Timestamped{T}" /> value has a different Value or Timestamp as the second <see cref="Timestamped{T}" /> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="Timestamped{T}" /> value has a different <see cref="Value"/> or <see cref="Timestamp"/> as the second <see cref="Timestamped{T}" /> value; otherwise, <c>false</c>.</returns>
         public static bool operator !=(Timestamped<T> first, Timestamped<T> second)
         {
             return !first.Equals(second);
@@ -84,7 +75,7 @@ namespace System.Reactive
         /// Determines whether the specified System.Object is equal to the current <see cref="Timestamped{T}" />.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="Timestamped{T}" />.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="Timestamped{T}" />; otherwise, false.</returns>
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="Timestamped{T}" />; otherwise, <c>false</c>.</returns>
         public override bool Equals(object obj)
         {
             if (!(obj is Timestamped<T>))
@@ -100,9 +91,7 @@ namespace System.Reactive
         /// <returns>A hash code for the current <see cref="Timestamped{T}" /> value.</returns>
         public override int GetHashCode()
         {
-            var valueHashCode = Value == null ? 1979 : Value.GetHashCode();
-
-            return _timestamp.GetHashCode() ^ valueHashCode;
+            return Timestamp.GetHashCode() ^ (Value?.GetHashCode() ?? 1979);
         }
 
         /// <summary>

+ 26 - 46
Rx.NET/Source/src/System.Reactive/Unit.cs

@@ -13,72 +13,52 @@ namespace System.Reactive
     public struct Unit : IEquatable<Unit>
     {
         /// <summary>
-        /// Determines whether the specified Unit values is equal to the current Unit. Because Unit has a single value, this always returns true.
+        /// Determines whether the specified <see cref="Unit"/> value is equal to the current <see cref="Unit"/>. Because <see cref="Unit"/> has a single value, this always returns <c>true</c>.
         /// </summary>
-        /// <param name="other">An object to compare to the current Unit value.</param>
-        /// <returns>Because Unit has a single value, this always returns true.</returns>
-        public bool Equals(Unit other)
-        {
-            return true;
-        }
+        /// <param name="other">An object to compare to the current <see cref="Unit"/> value.</param>
+        /// <returns>Because <see cref="Unit"/> has a single value, this always returns <c>true</c>.</returns>
+        public bool Equals(Unit other) => true;
 
         /// <summary>
-        /// Determines whether the specified System.Object is equal to the current Unit.
+        /// Determines whether the specified System.Object is equal to the current <see cref="Unit"/>.
         /// </summary>
-        /// <param name="obj">The System.Object to compare with the current Unit.</param>
-        /// <returns>true if the specified System.Object is a Unit value; otherwise, false.</returns>
-        public override bool Equals(object obj)
-        {
-            return obj is Unit;
-        }
+        /// <param name="obj">The System.Object to compare with the current <see cref="Unit"/>.</param>
+        /// <returns><c>true</c> if the specified System.Object is a <see cref="Unit"/> value; otherwise, <c>false</c>.</returns>
+        public override bool Equals(object obj) => obj is Unit;
 
         /// <summary>
-        /// Returns the hash code for the current Unit value.
+        /// Returns the hash code for the current <see cref="Unit"/> value.
         /// </summary>
-        /// <returns>A hash code for the current Unit value.</returns>
-        public override int GetHashCode()
-        {
-            return 0;
-        }
+        /// <returns>A hash code for the current <see cref="Unit"/> value.</returns>
+        public override int GetHashCode() => 0;
 
         /// <summary>
-        /// Returns a string representation of the current Unit value.
+        /// Returns a string representation of the current <see cref="Unit"/> value.
         /// </summary>
-        /// <returns>String representation of the current Unit value.</returns>
-        public override string ToString()
-        {
-            return "()";
-        }
+        /// <returns>String representation of the current <see cref="Unit"/> value.</returns>
+        public override string ToString() => "()";
 
         /// <summary>
-        /// Determines whether the two specified Unit values are equal. Because Unit has a single value, this always returns true.
+        /// Determines whether the two specified <see cref="Unit"/> values are equal. Because <see cref="Unit"/> has a single value, this always returns <c>true</c>.
         /// </summary>
-        /// <param name="first">The first Unit value to compare.</param>
-        /// <param name="second">The second Unit value to compare.</param>
-        /// <returns>Because Unit has a single value, this always returns true.</returns>
+        /// <param name="first">The first <see cref="Unit"/> value to compare.</param>
+        /// <param name="second">The second <see cref="Unit"/> value to compare.</param>
+        /// <returns>Because <see cref="Unit"/> has a single value, this always returns <c>true</c>.</returns>
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "first", Justification = "Parameter required for operator overloading."), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second", Justification = "Parameter required for operator overloading.")]
-        public static bool operator ==(Unit first, Unit second)
-        {
-            return true;
-        }
+        public static bool operator ==(Unit first, Unit second) => true;
 
         /// <summary>
-        /// Determines whether the two specified Unit values are not equal. Because Unit has a single value, this always returns false.
+        /// Determines whether the two specified <see cref="Unit"/> values are not equal. Because <see cref="Unit"/> has a single value, this always returns <c>false</c>.
         /// </summary>
-        /// <param name="first">The first Unit value to compare.</param>
-        /// <param name="second">The second Unit value to compare.</param>
-        /// <returns>Because Unit has a single value, this always returns false.</returns>
+        /// <param name="first">The first <see cref="Unit"/> value to compare.</param>
+        /// <param name="second">The second <see cref="Unit"/> value to compare.</param>
+        /// <returns>Because <see cref="Unit"/> has a single value, this always returns <c>false</c>.</returns>
         [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "first", Justification = "Parameter required for operator overloading."), System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA1801:ReviewUnusedParameters", MessageId = "second", Justification = "Parameter required for operator overloading.")]
-        public static bool operator !=(Unit first, Unit second)
-        {
-            return false;
-        }
-
-        static readonly Unit _default = new Unit();
+        public static bool operator !=(Unit first, Unit second) => false;
 
         /// <summary>
-        /// Gets the single unit value.
+        /// Gets the single <see cref="Unit"/> value.
         /// </summary>
-        public static Unit Default { get { return _default; } }
+        public static Unit Default => default(Unit);
     }
 }

+ 0 - 50
Rx.NET/Source/tests/Tests.System.Reactive/App.cs

@@ -1,50 +0,0 @@
-// Licensed to the .NET Foundation under one or more agreements.
-// 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. 
-
-#if SILVERLIGHT && !SILVERLIGHTM7
-using System;
-using System.Diagnostics;
-using System.Windows;
-using System.Windows.Browser;
-using Microsoft.Silverlight.Testing;
-
-namespace ReactiveTests
-{
-    public class App : Application
-    {
-        public App()
-        {
-            this.Startup += (o, e) =>
-            {
-                // TODO: Investigate UnitTestSettings configuration of TestService and LogProviders.
-                // var settings = new UnitTestSettings { StartRunImmediately = true };
-                RootVisual = UnitTestSystem.CreateTestPage(/* settings */);
-            };
-
-            this.UnhandledException += (o, e) =>
-            {
-                if (!Debugger.IsAttached)
-                {
-                    e.Handled = true;
-                    Deployment.Current.Dispatcher.BeginInvoke(delegate { ReportErrorToDOM(e); });
-                }
-            };
-        }
-
-        private void ReportErrorToDOM(ApplicationUnhandledExceptionEventArgs e)
-        {
-            try
-            {
-                string errorMsg = e.ExceptionObject.Message + e.ExceptionObject.StackTrace;
-                errorMsg = errorMsg.Replace('"', '\'').Replace("\r\n", @"\n");
-
-                HtmlPage.Window.Eval("throw new Error(\"Unhandled Error in Silverlight Application " + errorMsg + "\");");
-            }
-            catch (Exception)
-            {
-            }
-        }
-    }
-}
-#endif

+ 0 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Stress/Core/Schedulers/EventLoop.cs

@@ -58,11 +58,7 @@ namespace ReactiveTests.Stress.Schedulers
 
         private static int CurrentCount(this EventLoopScheduler scheduler)
         {
-#if !NO_CDS
             return ((SemaphoreSlim)semaphore.GetValue(scheduler)).CurrentCount;
-#else
-            return 0;
-#endif
         }
     }
 }

+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/Stress/Linq/ReplaySubject.cs

@@ -2,7 +2,7 @@
 // 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. 
 
-#if STRESS && !NO_TPL
+#if STRESS
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;

+ 0 - 42
Rx.NET/Source/tests/Tests.System.Reactive/TestBase.cs

@@ -3,51 +3,10 @@
 // See the LICENSE file in the project root for more information. 
 
 using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading;
 
 namespace ReactiveTests
 {
-#if SILVERLIGHT && !SILVERLIGHTM7
-    public class TestBase : Microsoft.Silverlight.Testing.SilverlightTest
-    {
-        public void RunAsync(Action<Waiter> a)
-        {
-            EnqueueCallback(() =>
-            {
-                var w = new Waiter(TestComplete);
-                a(w);
-                w.Wait();
-            });
-        }
-
-        public void CompleteAsync()
-        {
-            EnqueueTestComplete();
-        }
-    }
-
-    public class Waiter
-    {
-        private Action _complete;
-
-        public Waiter(Action complete)
-        {
-            _complete = complete;
-        }
-
-        public void Set()
-        {
-            _complete();
-        }
-
-        public void Wait()
-        {
-        }
-    }
-#else
     public class TestBase
     {
         public void RunAsync(Action<Waiter> a)
@@ -77,5 +36,4 @@ namespace ReactiveTests
     public class AsynchronousAttribute : Attribute
     {
     }
-#endif
 }

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/TestTaskScheduler.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. 
 
-#if !NO_TPL
 using System.Collections.Generic;
 using System.Threading.Tasks;
 
@@ -26,4 +25,3 @@ namespace ReactiveTests
         }
     }
 }
-#endif

+ 0 - 3
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/AsyncLockTest.cs

@@ -2,9 +2,7 @@
 // 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. 
 
-#if !SILVERLIGHT // MethodAccessException
 using System;
-using System.Threading.Tasks;
 using System.Reactive.Concurrency;
 using System.Reflection;
 using Xunit;
@@ -133,4 +131,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-#endif

+ 0 - 3
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/CurrentThreadSchedulerTest.cs

@@ -81,8 +81,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran);
         }
 
-#if !SILVERLIGHT
-
         [Fact(Skip ="")]
         public void CurrentThread_ScheduleActionDue()
         {
@@ -114,7 +112,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran, "ran");
             Assert.True(sw.ElapsedMilliseconds > 380, "due " + sw.ElapsedMilliseconds);
         }
-#endif
 #endif
         [Fact]
         public void CurrentThread_EnsureTrampoline()

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DefaultSchedulerTest.cs

@@ -41,7 +41,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
         }
 
-#if !SILVERLIGHT
         [Fact]
         public void ScheduleActionDue()
         {
@@ -51,7 +50,6 @@ namespace ReactiveTests.Tests
             nt.Schedule(TimeSpan.FromSeconds(0.2), () => { Assert.NotEqual(id, Thread.CurrentThread.ManagedThreadId); evt.Set(); });
             evt.WaitOne();
         }
-#endif
 
         [Fact]
         public void ScheduleActionCancel()

+ 0 - 10
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/DispatcherSchedulerTest.cs

@@ -12,10 +12,6 @@ using System.Windows.Threading;
 using Microsoft.Reactive.Testing;
 using Xunit;
 
-#if SILVERLIGHT && !SILVERLIGHTM7
-using Microsoft.Silverlight.Testing;
-#endif
-
 namespace ReactiveTests.Tests
 {
     
@@ -102,18 +98,13 @@ namespace ReactiveTests.Tests
                 var sch = new DispatcherScheduler(disp);
                 sch.Schedule(() =>
                 {
-#if SILVERLIGHT
-                    Assert.Equal(id, Thread.CurrentThread.ManagedThreadId); // Single-threaded test framework
-#else
                     Assert.NotEqual(id, Thread.CurrentThread.ManagedThreadId);
-#endif
                     disp.InvokeShutdown();
                     evt.Set();
                 });
             });
         }
 
-#if !USE_SL_DISPATCHER
         [Fact]
         public void ScheduleError()
         {
@@ -258,7 +249,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
             disp.InvokeShutdown();
         }
-#endif
     }
 }
 #endif

+ 1 - 5
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/EventLoopSchedulerTest.cs

@@ -226,7 +226,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran);
         }
 
-#if !SILVERLIGHT
         [Fact(Skip ="")]
         public void EventLoop_ScheduleActionDue()
         {
@@ -270,7 +269,6 @@ namespace ReactiveTests.Tests
             Assert.True(ran, "ran");
             Assert.True(sw.ElapsedMilliseconds > 380, "due " + sw.ElapsedMilliseconds);
         }
-#endif
 
 #if !NO_PERF
         [Fact]
@@ -280,7 +278,6 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#if !NO_CDS
         [Fact]
         public void EventLoop_Immediate()
         {
@@ -361,7 +358,6 @@ namespace ReactiveTests.Tests
                 }
             }
         }
-#endif
 
         [Fact]
         public void EventLoop_Periodic()
@@ -393,7 +389,7 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#if !NO_CDS && DESKTOPCLR
+#if DESKTOPCLR
         [Fact]
         public void EventLoop_CorrectWorkStealing()
         {

+ 2 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ImmediateSchedulerTest.cs

@@ -144,8 +144,8 @@ namespace ReactiveTests.Tests
             });
         }
 
-#if !SILVERLIGHT && !NO_THREAD
-        [Fact(Skip="Ignored")]        
+#if !NO_THREAD
+        [Fact(Skip="Ignored")]
         public void Immediate_ScheduleActionDue()
         {
             var id = Thread.CurrentThread.ManagedThreadId;

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/NewThreadSchedulerTest.cs

@@ -44,7 +44,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
         }
 
-#if !SILVERLIGHT
         [Fact(Skip = "")]
         public void NewThread_ScheduleActionDue()
         {
@@ -58,7 +57,6 @@ namespace ReactiveTests.Tests
             Assert.True(sw.ElapsedMilliseconds > 180, "due " + sw.ElapsedMilliseconds);
         }
 #endif
-#endif
 
 #if !NO_PERF
         [Fact]

+ 0 - 8
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SchedulerTest.cs

@@ -66,11 +66,9 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => NewThreadScheduler.Default.Schedule(default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => NewThreadScheduler.Default.Schedule(TimeSpan.Zero, default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => NewThreadScheduler.Default.Schedule(DateTimeOffset.MaxValue, default(Action)));
-#if !NO_TPL
             ReactiveAssert.Throws<ArgumentNullException>(() => TaskPoolScheduler.Default.Schedule(default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => TaskPoolScheduler.Default.Schedule(TimeSpan.Zero, default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => TaskPoolScheduler.Default.Schedule(DateTimeOffset.MaxValue, default(Action)));
-#endif
             ReactiveAssert.Throws<ArgumentNullException>(() => DefaultScheduler.Instance.Schedule(default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => DefaultScheduler.Instance.Schedule(TimeSpan.Zero, default(Action)));
             ReactiveAssert.Throws<ArgumentNullException>(() => DefaultScheduler.Instance.Schedule(DateTimeOffset.MaxValue, default(Action)));
@@ -196,14 +194,12 @@ namespace ReactiveTests.Tests
             }
 #endif
 
-#if !NO_TPL
             // TaskPool
             {
                 var e = new ManualResetEvent(false);
                 Scheduler.TaskPool.Schedule(() => e.Set());
                 e.WaitOne();
             }
-#endif
         }
 
         #endregion
@@ -243,7 +239,6 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => Scheduler.StartStopwatch(null));
         }
 
-#if !NO_TPL
         [Fact]
         public void Scheduler_LongRunning1()
         {
@@ -285,7 +280,6 @@ namespace ReactiveTests.Tests
 
             e.WaitOne();
         }
-#endif
 #endif
 
         #endregion
@@ -446,7 +440,6 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => Scheduler.DisableOptimizations(Scheduler.Default).Schedule(42, DateTimeOffset.Now, default(Func<IScheduler, int, IDisposable>)));
         }
 
-#if !NO_TPL
         [Fact]
         public void DisableOptimizations1()
         {
@@ -578,7 +571,6 @@ namespace ReactiveTests.Tests
             });
             e2.WaitOne();
         }
-#endif
 #endif
 
         [Fact]

+ 1 - 3
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SynchronizationContextSchedulerTest.cs

@@ -97,8 +97,7 @@ namespace ReactiveTests.Tests
             Assert.True(ms.Count == 1);
         }
 
-#if !SILVERLIGHT
-        [Fact]        
+        [Fact]
         public void SynchronizationContext_ScheduleActionDue()
         {
             var ms = new MySync();
@@ -112,7 +111,6 @@ namespace ReactiveTests.Tests
             Assert.True(sw.ElapsedMilliseconds > 180, "due " + sw.ElapsedMilliseconds);
             Assert.True(ms.Count == 1);
         }
-#endif
 
         class MySync : SynchronizationContext
         {

+ 0 - 6
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/SynchronizationTest.cs

@@ -19,11 +19,8 @@ namespace ReactiveTests.Tests
         {
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.SubscribeOn(default(IObservable<int>), Scheduler.Immediate));
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.SubscribeOn(DummyObservable<int>.Instance, default(IScheduler)));
-
-#if !NO_SYNCCTX
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.SubscribeOn(default(IObservable<int>), new MySyncCtx()));
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.SubscribeOn(DummyObservable<int>.Instance, default(SynchronizationContext)));
-#endif
         }
 
         [Fact]
@@ -31,11 +28,8 @@ namespace ReactiveTests.Tests
         {
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.ObserveOn(default(IObservable<int>), Scheduler.Immediate));
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.ObserveOn(DummyObservable<int>.Instance, default(IScheduler)));
-
-#if !NO_SYNCCTX
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.ObserveOn(default(IObservable<int>), new MySyncCtx()));
             ReactiveAssert.Throws<ArgumentNullException>(() => Synchronization.ObserveOn(DummyObservable<int>.Instance, default(SynchronizationContext)));
-#endif
         }
 
         [Fact]

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/TaskPoolSchedulerTest.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. 
 
-#if !NO_TPL
 using System;
 using System.Reactive.Concurrency;
 using System.Threading;
@@ -177,4 +176,3 @@ namespace ReactiveTests.Tests
         }
     }
 }
-#endif

+ 0 - 4
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/ThreadPoolSchedulerTest.cs

@@ -42,7 +42,6 @@ namespace ReactiveTests.Tests
             evt.WaitOne();
         }
 
-#if !NO_CDS
         [Fact]
         public void ProperRooting_NoGC_SingleShot()
         {
@@ -97,9 +96,7 @@ namespace ReactiveTests.Tests
 
             cts.Cancel();
         }
-#endif
 
-#if !SILVERLIGHT
         [Fact]
         public void ScheduleActionDueRelative()
         {
@@ -129,7 +126,6 @@ namespace ReactiveTests.Tests
             nt.Schedule(DateTimeOffset.UtcNow + TimeSpan.FromSeconds(0.2), () => { Assert.NotEqual(id, Thread.CurrentThread.ManagedThreadId); evt.Set(); });
             evt.WaitOne();
         }
-#endif
 
         [Fact]
         public void ScheduleActionCancel()

+ 1 - 1
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Concurrency/VirtualSchedulerTest.cs

@@ -112,7 +112,7 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws<ArgumentNullException>(() => new HistoricalScheduler().ScheduleRelative(42, TimeSpan.FromSeconds(1), default(Func<IScheduler, int, IDisposable>)));
         }
 
-#if !SILVERLIGHT && !NO_THREAD
+#if !NO_THREAD
         [Fact(Skip = "Ignored")]
         public void Virtual_ScheduleActionDue()
         {

+ 0 - 2
Rx.NET/Source/tests/Tests.System.Reactive/Tests/DefaultConcurrencyAbstractionLayerTest.cs

@@ -278,7 +278,6 @@ namespace ReactiveTests.Tests
             Assert.True(string.IsNullOrEmpty(r.Value));
         }
 
-#if !NO_TPL
         [Fact]
         public void Cant_Locate_Scheduler()
         {
@@ -308,7 +307,6 @@ namespace ReactiveTests.Tests
 
             Assert.True(e.Value);
         }
-#endif
 
 #if !NO_PERF
         [Fact]

+ 1 - 14
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableAsyncTest.cs

@@ -8,19 +8,15 @@ using System.Reactive;
 using System.Reactive.Concurrency;
 using System.Reactive.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
 
     public partial class ObservableAsyncTest : ReactiveTest
     {
-#if !NO_TPL
         private Task<int> doneTask;
 
         public ObservableAsyncTest()
@@ -30,7 +26,6 @@ namespace ReactiveTests.Tests
             doneTask = tcs.Task;
         }
 
-#endif
         #region FromAsyncPattern
 
         [Fact]
@@ -1291,8 +1286,6 @@ namespace ReactiveTests.Tests
 
         #region StartAsync
 
-#if !NO_TPL
-
         #region Func
 
         [Fact]
@@ -1684,14 +1677,10 @@ namespace ReactiveTests.Tests
 
         #endregion
 
-#endif
-
         #endregion
 
         #region FromAsync
 
-#if !NO_TPL
-
         #region Func
 
         [Fact]
@@ -2062,8 +2051,6 @@ namespace ReactiveTests.Tests
 
         #endregion
 
-#endif
-
         #endregion
 
         #region ToAsync

+ 23 - 40
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableBlockingTest.cs

@@ -10,17 +10,14 @@ using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Reactive.Linq;
 using System.Threading;
+using System.Threading.Tasks;
 using Microsoft.Reactive.Testing;
 using Xunit;
 using ReactiveTests.Dummies;
 
-#if !NO_TPL
-using System.Threading.Tasks;
-#endif
-
 namespace ReactiveTests.Tests
 {
-    
+
     public partial class ObservableBlockingTest : ReactiveTest
     {
         #region Chunkify
@@ -657,9 +654,9 @@ namespace ReactiveTests.Tests
             }
         }
 
-#endregion
+        #endregion
 
-#region + ForEach +
+        #region + ForEach +
 
         [Fact]
         public void ForEach_ArgumentChecking()
@@ -765,9 +762,9 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws(ex, () => xs.ForEach((x, i) => { throw ex; }));
         }
 
-#endregion
+        #endregion
 
-#region + GetEnumerator +
+        #region + GetEnumerator +
 
         [Fact]
         public void GetEnumerator_ArgumentChecking()
@@ -916,23 +913,9 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if DESKTOPCLR20 || SILVERLIGHTM7
-        class Tuple<T1, T2>
-        {
-            public Tuple(T1 item1, T2 item2)
-            {
-                Item1 = item1;
-                Item2 = item2;
-            }
-
-            public T1 Item1 { get; private set; }
-            public T2 Item2 { get; private set; }
-        }
-#endif
-
-#endregion
+        #endregion
 
-#region Last
+        #region Last
 
         [Fact]
         public void Last_ArgumentChecking()
@@ -985,9 +968,9 @@ namespace ReactiveTests.Tests
             Assert.Equal(50, Observable.Range(value, 10).Last(i => i % 2 == 0));
         }
 
-#endregion
+        #endregion
 
-#region LastOrDefault
+        #region LastOrDefault
 
         [Fact]
         public void LastOrDefault_ArgumentChecking()
@@ -1040,9 +1023,9 @@ namespace ReactiveTests.Tests
             Assert.Equal(50, Observable.Range(value, 10).LastOrDefault(i => i % 2 == 0));
         }
 
-#endregion
+        #endregion
 
-#region + Latest +
+        #region + Latest +
 
         [Fact]
         public void Latest_ArgumentChecking()
@@ -1201,9 +1184,9 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws(ex, () => res.MoveNext());
         }
 
-#endregion
+        #endregion
 
-#region + MostRecent +
+        #region + MostRecent +
 
         [Fact]
         public void MostRecent_ArgumentChecking()
@@ -1387,9 +1370,9 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws(ex, () => res.MoveNext());
         }
 
-#endregion
+        #endregion
 
-#region + Next +
+        #region + Next +
 
         [Fact]
         public void Next_ArgumentChecking()
@@ -1541,9 +1524,9 @@ namespace ReactiveTests.Tests
             ReactiveAssert.Throws(ex, () => res.MoveNext());
         }
 #endif
-#endregion
+        #endregion
 
-#region Single
+        #region Single
 
         [Fact]
         public void Single_ArgumentChecking()
@@ -1603,9 +1586,9 @@ namespace ReactiveTests.Tests
             Assert.Equal(45, Observable.Range(value, 10).Single(i => i == 45));
         }
 
-#endregion
+        #endregion
 
-#region SingleOrDefault
+        #region SingleOrDefault
 
         [Fact]
         public void SingleOrDefault_ArgumentChecking()
@@ -1672,9 +1655,9 @@ namespace ReactiveTests.Tests
             Assert.Equal(0, Observable.Range(value, 10).SingleOrDefault(i => i > 100));
         }
 
-#endregion
+        #endregion
 
-#region Wait
+        #region Wait
 
         [Fact]
         public void Wait_ArgumentChecking()
@@ -1719,6 +1702,6 @@ namespace ReactiveTests.Tests
             Assert.Equal(n, res);
         }
 #endif
-#endregion
+        #endregion
     }
 }

+ 18 - 28
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConcurrencyTest.cs

@@ -22,16 +22,12 @@ using ReactiveTests.Dummies;
 using System.Windows.Forms;
 #endif
 
-#if SILVERLIGHT && !SILVERLIGHTM7
-using Microsoft.Silverlight.Testing;
-#endif
-
 namespace ReactiveTests.Tests
 {
-    
+
     public partial class ObservableConcurrencyTest : TestBase
     {
-#region + ObserveOn +
+        #region + ObserveOn +
 
         [Fact]
         public void ObserveOn_ArgumentChecking()
@@ -226,9 +222,9 @@ namespace ReactiveTests.Tests
             });
         }
 #endif
-#endregion
+        #endregion
 
-#region SubscribeOn
+        #region SubscribeOn
 
         [Fact]
         public void SubscribeOn_ArgumentChecking()
@@ -426,9 +422,9 @@ namespace ReactiveTests.Tests
             });
         }
 #endif
-#endregion
+        #endregion
 
-#region + Synchronize +
+        #region + Synchronize +
 
         [Fact]
         public void Synchronize_ArgumentChecking()
@@ -539,13 +535,13 @@ namespace ReactiveTests.Tests
             Assert.Equal(Enumerable.Range(0, 200).Sum(), sum);
         }
 #endif
-#endregion
+        #endregion
     }
 
-    
+
     public class ObservableConcurrencyReactiveTest : ReactiveTest
     {
-#region + ObserveOn +
+        #region + ObserveOn +
 
         [Fact]
         public void ObserveOn_Scheduler_ArgumentChecking()
@@ -560,7 +556,7 @@ namespace ReactiveTests.Tests
             var scheduler = new TestScheduler();
 
             var xs = scheduler.CreateHotObservable(
-                OnNext( 90, 1),
+                OnNext(90, 1),
                 OnNext(120, 2),
                 OnNext(230, 3),
                 OnNext(240, 4),
@@ -581,7 +577,7 @@ namespace ReactiveTests.Tests
                 OnCompleted<int>(531)
             );
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
             // BREAKING CHANGE v2 > v1.x -> More aggressive disposal behavior
             xs.Subscriptions.AssertEqual(
                 Subscribe(200, 531)
@@ -626,7 +622,7 @@ namespace ReactiveTests.Tests
                 OnError<int>(531, ex)
             );
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
             // BREAKING CHANGE v2 > v1.x -> More aggressive disposal behavior
             xs.Subscriptions.AssertEqual(
                 Subscribe(200, 531)
@@ -754,7 +750,7 @@ namespace ReactiveTests.Tests
             }
         }
 
-#if !NO_PERF && !NO_CDS
+#if !NO_PERF
         [Fact]
         public void ObserveOn_LongRunning_Simple()
         {
@@ -935,7 +931,6 @@ namespace ReactiveTests.Tests
         }
 #endif
 
-#if !NO_SYNCCTX
         [Fact]
         public void ObserveOn_SynchronizationContext_Simple()
         {
@@ -967,11 +962,10 @@ namespace ReactiveTests.Tests
                 Subscribe(200, 531)
             );
         }
-#endif
 
-#endregion
+        #endregion
 
-#region SubscribeOn
+        #region SubscribeOn
 
         [Fact]
         public void SubscribeOn_Scheduler_ArgumentChecking()
@@ -1071,7 +1065,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if !NO_SYNCCTX
         [Fact]
         public void SubscribeOn_SynchronizationContext_Simple()
         {
@@ -1103,13 +1096,11 @@ namespace ReactiveTests.Tests
                 Subscribe(201, 531)
             );
         }
-#endif
 
-#endregion
+        #endregion
 
-#region |> Helpers <|
+        #region |> Helpers <|
 
-#if !NO_SYNCCTX
         class MyCtx : SynchronizationContext
         {
             private IScheduler scheduler;
@@ -1124,8 +1115,7 @@ namespace ReactiveTests.Tests
                 scheduler.Schedule(state, (self, s) => { d(s); return Disposable.Empty; });
             }
         }
-#endif
 
-#endregion
+        #endregion
     }
 }

+ 0 - 8
Rx.NET/Source/tests/Tests.System.Reactive/Tests/Linq/ObservableConversionTests.cs

@@ -125,7 +125,6 @@ namespace ReactiveTests.Tests
             );
         }
 
-#if !SILVERLIGHTM7
         [Fact]
         public void SubscribeToEnumerable_DefaultScheduler()
         {
@@ -151,7 +150,6 @@ namespace ReactiveTests.Tests
                 results1.AssertEqual(results2);
             }
         }
-#endif
 
         #endregion
 
@@ -485,10 +483,8 @@ namespace ReactiveTests.Tests
             src.OnCompleted();
             Assert.Equal(2, num);
 
-#if !SILVERLIGHT // FieldAccessException
             var tbl = GetSubscriptionTable(evt);
             Assert.True(tbl.Count == 0);
-#endif
         }
 
         [Fact]
@@ -514,10 +510,8 @@ namespace ReactiveTests.Tests
 
             ReactiveAssert.Throws(ex, () => src.OnError(ex));
 
-#if !SILVERLIGHT // FieldAccessException
             var tbl = GetSubscriptionTable(evt);
             Assert.True(tbl.Count == 0);
-#endif
         }
 
         [Fact]
@@ -535,10 +529,8 @@ namespace ReactiveTests.Tests
 
                 Assert.Equal(0, num);
 
-#if !SILVERLIGHT // FieldAccessException
                 var tbl = GetSubscriptionTable(evt);
                 Assert.True(tbl.Count == 0);
-#endif
             }
         }
 

Một số tệp đã không được hiển thị bởi vì quá nhiều tập tin thay đổi trong này khác