Преглед на файлове

Merge branch 'develop' into WeGotSyncCtxNow

Oren Novotny преди 8 години
родител
ревизия
92e88181c2
променени са 46 файла, в които са добавени 485 реда и са изтрити 585 реда
  1. 1 1
      Rx.NET/Source/src/Microsoft.Reactive.Testing/MockObserver.cs
  2. 0 1
      Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.cs
  3. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.cs
  4. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.Windows.cs
  5. 0 17
      Rx.NET/Source/src/System.Reactive/Concurrency/ConcurrencyAbstractionLayerImpl.cs
  6. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/DefaultScheduler.cs
  7. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/DisableOptimizationsScheduler.cs
  8. 2 12
      Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.TimerQueue.cs
  9. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.cs
  10. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Recursive.cs
  11. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs
  12. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.cs
  13. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Simple.cs
  14. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Wrappers.cs
  15. 0 3
      Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.cs
  16. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerDefaults.cs
  17. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerQueue.cs
  18. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.cs
  19. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.ObserveOn.cs
  20. 0 2
      Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.Synchronize.cs
  21. 0 1
      Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.cs
  22. 1 1
      Rx.NET/Source/src/System.Reactive/Concurrency/SynchronizationContextScheduler.cs
  23. 0 8
      Rx.NET/Source/src/System.Reactive/Concurrency/TaskHelpers.cs
  24. 0 3
      Rx.NET/Source/src/System.Reactive/Concurrency/Thread.Stub.cs
  25. 4 4
      Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.Windows.cs
  26. 0 16
      Rx.NET/Source/src/System.Reactive/Concurrency/ThreadPoolScheduler.cs
  27. 0 2
      Rx.NET/Source/src/System.Reactive/Disposables/RefCountDisposable.cs
  28. 0 2
      Rx.NET/Source/src/System.Reactive/EnlightenmentProvider.cs
  29. 0 1
      Rx.NET/Source/src/System.Reactive/Internal/CheckedObserver.cs
  30. 0 1
      Rx.NET/Source/src/System.Reactive/Internal/ConcatSink.cs
  31. 0 1
      Rx.NET/Source/src/System.Reactive/Internal/CurrentPlatformEnlightenmentProvider.cs
  32. 0 2
      Rx.NET/Source/src/System.Reactive/Internal/Helpers.cs
  33. 0 1
      Rx.NET/Source/src/System.Reactive/Internal/IConcatenatable.cs
  34. 0 3
      Rx.NET/Source/src/System.Reactive/Internal/PlatformEnlightenmentProvider.cs
  35. 0 1
      Rx.NET/Source/src/System.Reactive/Internal/QueryServices.cs
  36. 0 2
      Rx.NET/Source/src/System.Reactive/Internal/SafeObserver.cs
  37. 52 52
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Aggregates.cs
  38. 152 152
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Async.cs
  39. 15 15
      Rx.NET/Source/src/System.Reactive/Linq/Observable.Events.cs
  40. 203 203
      Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs
  41. 23 23
      Rx.NET/Source/src/System.Reactive/Linq/QbservableEx.Generated.cs
  42. 6 6
      Rx.NET/Source/src/System.Reactive/Platforms/Windows/Concurrency/CoreDispatcherScheduler.cs
  43. 20 20
      Rx.NET/Source/src/System.Reactive/Platforms/Windows/Linq/CoreDispatcherObservable.cs
  44. 0 1
      Rx.NET/Source/src/System.Reactive/Subjects/AsyncSubject.cs
  45. 2 2
      Rx.NET/Source/src/System.Reactive/Subjects/Subject.cs
  46. 3 4
      Rx.NET/Source/src/System.Reactive/Subjects/SubjectBase.cs

+ 1 - 1
Rx.NET/Source/src/Microsoft.Reactive.Testing/MockObserver.cs

@@ -16,7 +16,7 @@ namespace Microsoft.Reactive.Testing
         public MockObserver(TestScheduler scheduler)
         {
             if (scheduler == null)
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
 
             this.scheduler = scheduler;
             this.messages = new List<Recorded<Notification<T>>>();

+ 0 - 1
Rx.NET/Source/src/System.Reactive/AnonymousSafeObserver.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;
 using System.Threading;
 
 namespace System.Reactive

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/CatchScheduler.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;
 using System.Reactive.Disposables;
 
 #if !NO_WEAKTABLE

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

@@ -34,7 +34,7 @@ namespace System.Reactive.Concurrency
             // for more information.
             //
             if (period < TimeSpan.FromMilliseconds(1))
-                throw new ArgumentOutOfRangeException("period", Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
+                throw new ArgumentOutOfRangeException(nameof(period), Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
 
             var res = global::Windows.System.Threading.ThreadPoolTimer.CreatePeriodicTimer(
                 tpt =>

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

@@ -249,11 +249,7 @@ namespace System.Reactive.Concurrency
             //
             // Note: the dictionary exists to "root" the timers so that they are not garbage collected and finalized while they are running.
             //
-#if !NO_HASHSET
             private static readonly HashSet<System.Threading.Timer> s_timers = new HashSet<System.Threading.Timer>();
-#else
-            private static readonly Dictionary<System.Threading.Timer, object> s_timers = new Dictionary<System.Threading.Timer, object>();
-#endif
 
             private Action<object> _action;
             private System.Threading.Timer _timer;
@@ -270,12 +266,7 @@ namespace System.Reactive.Concurrency
                 {
                     if (!_hasRemoved)
                     {
-#if !NO_HASHSET
                         s_timers.Add(_timer);
-#else
-                        s_timers.Add(_timer, null);
-#endif
-
                         _hasAdded = true;
                     }
                 }
@@ -323,11 +314,7 @@ namespace System.Reactive.Concurrency
             //
             // Note: the dictionary exists to "root" the timers so that they are not garbage collected and finalized while they are running.
             //
-#if !NO_HASHSET
             private static readonly HashSet<System.Threading.Timer> s_timers = new HashSet<System.Threading.Timer>();
-#else
-            private static readonly Dictionary<System.Threading.Timer, object> s_timers = new Dictionary<System.Threading.Timer, object>();
-#endif
 
             private Action _action;
             private System.Threading.Timer _timer;
@@ -339,11 +326,7 @@ namespace System.Reactive.Concurrency
 
                 lock (s_timers)
                 {
-#if !NO_HASHSET
                     s_timers.Add(_timer);
-#else
-                    s_timers.Add(_timer, null);
-#endif
                 }
             }
 

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/DefaultScheduler.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. 
 
-using System.Collections.Generic;
 using System.Reactive.Disposables;
-using System.Threading;
 
 namespace System.Reactive.Concurrency
 {

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/DisableOptimizationsScheduler.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;
 using System.Linq;
 
 #if !NO_WEAKTABLE

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

@@ -55,11 +55,7 @@ namespace System.Reactive.Concurrency
         /// Set of disposable handles to all of the current short term work Schedule calls,
         /// allowing those to be cancelled upon a system clock change.
         /// </summary>
-#if !NO_HASHSET
         private readonly HashSet<IDisposable> _shortTermWork = new HashSet<IDisposable>();
-#else
-        private readonly Dictionary<IDisposable, object> _shortTermWork = new Dictionary<IDisposable, object>();
-#endif
 
         /// <summary>
         /// Threshold where an item is considered to be short term work or gets moved from
@@ -191,11 +187,7 @@ namespace System.Reactive.Concurrency
                 // of WorkItem.Invoke.
                 //
                 var d = new SingleAssignmentDisposable();
-#if !NO_HASHSET
                 _shortTermWork.Add(d);
-#else
-                _shortTermWork.Add(d, null);
-#endif
 
                 //
                 // We normalize the time delta again (possibly redundant), because we can't assume
@@ -386,12 +378,10 @@ namespace System.Reactive.Concurrency
                     // is used to notice race conditions between cancellation and the timer firing (also
                     // guarded by the same gate object). See checks in ExecuteNextShortTermWorkItem.
                     //
-#if !NO_HASHSET
                     foreach (var d in _shortTermWork)
-#else
-                    foreach (var d in _shortTermWork.Keys)
-#endif
+                    {
                         d.Dispose();
+                    }
 
                     _shortTermWork.Clear();
 

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/LocalScheduler.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. 
 
-using System;
-
 namespace System.Reactive.Concurrency
 {
     /// <summary>

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Recursive.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;
 using System.Reactive.Disposables;
 
 namespace System.Reactive.Concurrency

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.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;
 using System.Diagnostics;
 using System.Reactive.Disposables;
 using System.Reactive.PlatformServices;

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.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. 
 
-using System;
-
 namespace System.Reactive.Concurrency
 {
     //

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Simple.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;
 using System.Reactive.Disposables;
 
 namespace System.Reactive.Concurrency

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Wrappers.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. 
 
-using System;
-
 namespace System.Reactive.Concurrency
 {
     public static partial class Scheduler

+ 0 - 3
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.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. 
 
-using System;
-using System.Reactive.Disposables;
 using System.Reactive.PlatformServices;
 using System.Globalization;
 
@@ -19,7 +17,6 @@ namespace System.Reactive.Concurrency
 
         // HACK: Causes race condition with Locks in DefaultScheduler's static ctor chain
         // private static DefaultScheduler s_default = DefaultScheduler.Instance;
-        
 
         /// <summary>
         /// Gets the current time according to the local machine's system clock.

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerDefaults.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. 
 
-using System;
-
 namespace System.Reactive.Concurrency
 {
     internal static class SchedulerDefaults

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerQueue.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. 
 
-using System;
-
 namespace System.Reactive.Concurrency
 {
     /// <summary>

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Concurrency/SchedulerWrapper.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. 
 
-using System;
-
 #if !NO_WEAKTABLE
 using System.Runtime.CompilerServices;
 #endif

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

@@ -3,8 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 #if !NO_PERF
-using System;
-using System.Reactive.Concurrency;
 using System.Reactive.Disposables;
 using System.Threading;
 

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

@@ -3,8 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 #if !NO_PERF
-using System;
-
 namespace System.Reactive.Concurrency
 {
     class Synchronize<TSource> : Producer<TSource>

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Concurrency/Synchronization.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;
 using System.ComponentModel;
 using System.Reactive.Disposables;
 using System.Threading;

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

@@ -24,7 +24,7 @@ namespace System.Reactive.Concurrency
         {
             if (context == null)
                 throw new ArgumentNullException(nameof(context));
-            
+
             _context = context;
             _alwaysPost = true;
         }

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

@@ -21,20 +21,12 @@ namespace System.Reactive.Concurrency
                 var remainder = delay - TimeSpan.FromMilliseconds(MAX_DELAY);
 
                 return
-#if USE_TASKEX
-                    TaskEx.Delay(MAX_DELAY, token)
-#else
                     Task.Delay(MAX_DELAY, token)
-#endif
                         .ContinueWith(_ => Delay(remainder, token), TaskContinuationOptions.ExecuteSynchronously)
                         .Unwrap();
             }
 
-#if USE_TASKEX
-            return TaskEx.Delay(delay, token);
-#else
             return Task.Delay(delay, token);
-#endif
         }
     }
 }

+ 0 - 3
Rx.NET/Source/src/System.Reactive/Concurrency/Thread.Stub.cs

@@ -3,9 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 #if NO_THREAD
-using System;
-using System.Threading;
-
 namespace System.Reactive.Concurrency
 {
     class Thread

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

@@ -86,7 +86,7 @@ namespace System.Reactive.Concurrency
         public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
         {
             if (action == null)
-                throw new ArgumentNullException("action");
+                throw new ArgumentNullException(nameof(action));
 
             var d = new SingleAssignmentDisposable();
 
@@ -114,7 +114,7 @@ namespace System.Reactive.Concurrency
         public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
         {
             if (action == null)
-                throw new ArgumentNullException("action");
+                throw new ArgumentNullException(nameof(action));
 
             var dt = Scheduler.Normalize(dueTime);
 
@@ -157,9 +157,9 @@ namespace System.Reactive.Concurrency
             // for more information.
             //
             if (period < TimeSpan.FromMilliseconds(1))
-                throw new ArgumentOutOfRangeException("period", Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
+                throw new ArgumentOutOfRangeException(nameof(period), Strings_PlatformServices.WINRT_NO_SUB1MS_TIMERS);
             if (action == null)
-                throw new ArgumentNullException("action");
+                throw new ArgumentNullException(nameof(action));
 
             var state1 = state;
             var gate = new AsyncLock();

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

@@ -295,11 +295,7 @@ namespace System.Reactive.Concurrency
             //
             // Note: the dictionary exists to "root" the timers so that they are not garbage collected and finalized while they are running.
             //
-#if !NO_HASHSET
             protected static readonly HashSet<System.Threading.Timer> s_timers = new HashSet<System.Threading.Timer>();
-#else
-            protected static readonly Dictionary<System.Threading.Timer, object> s_timers = new Dictionary<System.Threading.Timer, object>();
-#endif
         }
 
         sealed class Timer<TState> : Timer, IDisposable
@@ -330,11 +326,7 @@ namespace System.Reactive.Concurrency
                 {
                     if (!_hasRemoved)
                     {
-#if !NO_HASHSET
                         s_timers.Add(_timer);
-#else
-                        s_timers.Add(_timer, null);
-#endif
 
                         _hasAdded = true;
                     }
@@ -393,11 +385,7 @@ namespace System.Reactive.Concurrency
             //
             // Note: the dictionary exists to "root" the timers so that they are not garbage collected and finalized while they are running.
             //
-#if !NO_HASHSET
             protected static readonly HashSet<System.Threading.Timer> s_timers = new HashSet<System.Threading.Timer>();
-#else
-            protected static readonly Dictionary<System.Threading.Timer, object> s_timers = new Dictionary<System.Threading.Timer, object>();
-#endif
         }
 
         sealed class PeriodicTimer<TState> : PeriodicTimer, IDisposable
@@ -418,11 +406,7 @@ namespace System.Reactive.Concurrency
 
                 lock (s_timers)
                 {
-#if !NO_HASHSET
                     s_timers.Add(_timer);
-#else
-                    s_timers.Add(_timer, null);
-#endif
                 }
             }
 

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Disposables/RefCountDisposable.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;
 using System.Threading;
 
 namespace System.Reactive.Disposables
@@ -25,7 +24,6 @@ namespace System.Reactive.Disposables
         /// <exception cref="ArgumentNullException"><paramref name="disposable"/> is null.</exception>
         public RefCountDisposable(IDisposable disposable) : this(disposable, false)
         {
-            
         }
 
         /// <summary>

+ 0 - 2
Rx.NET/Source/src/System.Reactive/EnlightenmentProvider.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. 
 
-using System.Reactive.Concurrency;
-
 namespace System.Reactive.PlatformServices
 {
     /// <summary>

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Internal/CheckedObserver.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;
 using System.Threading;
 
 namespace System.Reactive

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Internal/ConcatSink.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;
 using System.Collections.Generic;
 
 namespace System.Reactive

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

@@ -7,7 +7,6 @@
 //
 using System.ComponentModel;
 using System.Diagnostics;
-using System.Reactive;
 using System.Reactive.Concurrency;
 using System.Reactive.Linq;
 using System.Reflection;

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

@@ -3,9 +3,7 @@
 // See the LICENSE file in the project root for more information. 
 
 #if !NO_PERF
-using System;
 using System.Collections.Generic;
-using System.Reactive.Linq.ObservableImpl;
 
 namespace System.Reactive
 {

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Internal/IConcatenatable.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;
 using System.Collections.Generic;
 
 namespace System.Reactive

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

@@ -3,7 +3,6 @@
 // See the LICENSE file in the project root for more information. 
 
 using System.ComponentModel;
-using System.Reflection;
 
 namespace System.Reactive.PlatformServices
 {
@@ -63,6 +62,4 @@ namespace System.Reactive.PlatformServices
             return new CurrentPlatformEnlightenmentProvider();
         }
     }
-
-
 }

+ 0 - 1
Rx.NET/Source/src/System.Reactive/Internal/QueryServices.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;
 using System.Reactive.PlatformServices;
 
 namespace System.Reactive.Linq

+ 0 - 2
Rx.NET/Source/src/System.Reactive/Internal/SafeObserver.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. 
 
-using System;
-
 namespace System.Reactive
 {
     //

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

@@ -1786,11 +1786,11 @@ namespace System.Reactive.Linq
         public static IObservable<IList<TSource>> MinBy<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IComparer<TKey> comparer)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
+                throw new ArgumentNullException(nameof(keySelector));
             if (comparer == null)
-                throw new ArgumentNullException("comparer");
+                throw new ArgumentNullException(nameof(comparer));
 
             return s_impl.MinBy<TSource, TKey>(source, keySelector, comparer);
         }
@@ -1831,11 +1831,11 @@ namespace System.Reactive.Linq
         public static IObservable<bool> SequenceEqual<TSource>(this IObservable<TSource> first, IObservable<TSource> second, IEqualityComparer<TSource> comparer)
         {
             if (first == null)
-                throw new ArgumentNullException("first");
+                throw new ArgumentNullException(nameof(first));
             if (second == null)
-                throw new ArgumentNullException("second");
+                throw new ArgumentNullException(nameof(second));
             if (comparer == null)
-                throw new ArgumentNullException("comparer");
+                throw new ArgumentNullException(nameof(comparer));
 
             return s_impl.SequenceEqual<TSource>(first, second, comparer);
         }
@@ -1872,11 +1872,11 @@ namespace System.Reactive.Linq
         public static IObservable<bool> SequenceEqual<TSource>(this IObservable<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer)
         {
             if (first == null)
-                throw new ArgumentNullException("first");
+                throw new ArgumentNullException(nameof(first));
             if (second == null)
-                throw new ArgumentNullException("second");
+                throw new ArgumentNullException(nameof(second));
             if (comparer == null)
-                throw new ArgumentNullException("comparer");
+                throw new ArgumentNullException(nameof(comparer));
 
             return s_impl.SequenceEqual<TSource>(first, second, comparer);
         }
@@ -1952,9 +1952,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SingleOrDefaultAsync<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (predicate == null)
-                throw new ArgumentNullException("predicate");
+                throw new ArgumentNullException(nameof(predicate));
 
             return s_impl.SingleOrDefaultAsync<TSource>(source, predicate);
         }
@@ -2004,7 +2004,7 @@ namespace System.Reactive.Linq
         public static IObservable<decimal> Sum(this IObservable<decimal> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2020,7 +2020,7 @@ namespace System.Reactive.Linq
         public static IObservable<int> Sum(this IObservable<int> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2036,7 +2036,7 @@ namespace System.Reactive.Linq
         public static IObservable<long> Sum(this IObservable<long> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2051,7 +2051,7 @@ namespace System.Reactive.Linq
         public static IObservable<double?> Sum(this IObservable<double?> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2066,7 +2066,7 @@ namespace System.Reactive.Linq
         public static IObservable<float?> Sum(this IObservable<float?> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2082,7 +2082,7 @@ namespace System.Reactive.Linq
         public static IObservable<decimal?> Sum(this IObservable<decimal?> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2098,7 +2098,7 @@ namespace System.Reactive.Linq
         public static IObservable<int?> Sum(this IObservable<int?> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2114,7 +2114,7 @@ namespace System.Reactive.Linq
         public static IObservable<long?> Sum(this IObservable<long?> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.Sum(source);
         }
@@ -2131,9 +2131,9 @@ namespace System.Reactive.Linq
         public static IObservable<double> Sum<TSource>(this IObservable<TSource> source, Func<TSource, double> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2150,9 +2150,9 @@ namespace System.Reactive.Linq
         public static IObservable<float> Sum<TSource>(this IObservable<TSource> source, Func<TSource, float> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2170,9 +2170,9 @@ namespace System.Reactive.Linq
         public static IObservable<decimal> Sum<TSource>(this IObservable<TSource> source, Func<TSource, decimal> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2190,9 +2190,9 @@ namespace System.Reactive.Linq
         public static IObservable<int> Sum<TSource>(this IObservable<TSource> source, Func<TSource, int> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2210,9 +2210,9 @@ namespace System.Reactive.Linq
         public static IObservable<long> Sum<TSource>(this IObservable<TSource> source, Func<TSource, long> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2229,9 +2229,9 @@ namespace System.Reactive.Linq
         public static IObservable<double?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, double?> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2248,9 +2248,9 @@ namespace System.Reactive.Linq
         public static IObservable<float?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, float?> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2268,9 +2268,9 @@ namespace System.Reactive.Linq
         public static IObservable<decimal?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, decimal?> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2288,9 +2288,9 @@ namespace System.Reactive.Linq
         public static IObservable<int?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, int?> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2308,9 +2308,9 @@ namespace System.Reactive.Linq
         public static IObservable<long?> Sum<TSource>(this IObservable<TSource> source, Func<TSource, long?> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
 
             return s_impl.Sum<TSource>(source, selector);
         }
@@ -2330,7 +2330,7 @@ namespace System.Reactive.Linq
         public static IObservable<TSource[]> ToArray<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return s_impl.ToArray<TSource>(source);
         }
@@ -2352,9 +2352,9 @@ namespace System.Reactive.Linq
         public static IObservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
+                throw new ArgumentNullException(nameof(keySelector));
 
             return s_impl.ToDictionary<TSource, TKey>(source, keySelector);
         }
@@ -2373,11 +2373,11 @@ namespace System.Reactive.Linq
         public static IObservable<IDictionary<TKey, TSource>> ToDictionary<TSource, TKey>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, IEqualityComparer<TKey> comparer)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
+                throw new ArgumentNullException(nameof(keySelector));
             if (comparer == null)
-                throw new ArgumentNullException("comparer");
+                throw new ArgumentNullException(nameof(comparer));
 
             return s_impl.ToDictionary<TSource, TKey>(source, keySelector, comparer);
         }
@@ -2397,11 +2397,11 @@ namespace System.Reactive.Linq
         public static IObservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
+                throw new ArgumentNullException(nameof(keySelector));
             if (elementSelector == null)
-                throw new ArgumentNullException("elementSelector");
+                throw new ArgumentNullException(nameof(elementSelector));
 
             return s_impl.ToDictionary<TSource, TKey, TElement>(source, keySelector, elementSelector);
         }
@@ -2422,13 +2422,13 @@ namespace System.Reactive.Linq
         public static IObservable<IDictionary<TKey, TElement>> ToDictionary<TSource, TKey, TElement>(this IObservable<TSource> source, Func<TSource, TKey> keySelector, Func<TSource, TElement> elementSelector, IEqualityComparer<TKey> comparer)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (keySelector == null)
-                throw new ArgumentNullException("keySelector");
+                throw new ArgumentNullException(nameof(keySelector));
             if (elementSelector == null)
-                throw new ArgumentNullException("elementSelector");
+                throw new ArgumentNullException(nameof(elementSelector));
             if (comparer == null)
-                throw new ArgumentNullException("comparer");
+                throw new ArgumentNullException(nameof(comparer));
 
             return s_impl.ToDictionary<TSource, TKey, TElement>(source, keySelector, elementSelector, comparer);
         }

Файловите разлики са ограничени, защото са твърде много
+ 152 - 152
Rx.NET/Source/src/System.Reactive/Linq/Observable.Async.cs


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

@@ -48,9 +48,9 @@ namespace System.Reactive.Linq
         public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler)
         {
             if (addHandler == null)
-                throw new ArgumentNullException("addHandler");
+                throw new ArgumentNullException(nameof(addHandler));
             if (removeHandler == null)
-                throw new ArgumentNullException("removeHandler");
+                throw new ArgumentNullException(nameof(removeHandler));
 
             return s_impl.FromEventPattern(addHandler, removeHandler);
         }
@@ -96,11 +96,11 @@ namespace System.Reactive.Linq
         public static IObservable<EventPattern<EventArgs>> FromEventPattern(Action<EventHandler> addHandler, Action<EventHandler> removeHandler, IScheduler scheduler)
         {
             if (addHandler == null)
-                throw new ArgumentNullException("addHandler");
+                throw new ArgumentNullException(nameof(addHandler));
             if (removeHandler == null)
-                throw new ArgumentNullException("removeHandler");
+                throw new ArgumentNullException(nameof(removeHandler));
             if (scheduler == null)
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
 
             return s_impl.FromEventPattern(addHandler, removeHandler, scheduler);
         }
@@ -521,9 +521,9 @@ namespace System.Reactive.Linq
         public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName)
         {
             if (target == null)
-                throw new ArgumentNullException("target");
+                throw new ArgumentNullException(nameof(target));
             if (eventName == null)
-                throw new ArgumentNullException("eventName");
+                throw new ArgumentNullException(nameof(eventName));
 
             return s_impl.FromEventPattern(target, eventName);
         }
@@ -571,11 +571,11 @@ namespace System.Reactive.Linq
         public static IObservable<EventPattern<EventArgs>> FromEventPattern(object target, string eventName, IScheduler scheduler)
         {
             if (target == null)
-                throw new ArgumentNullException("target");
+                throw new ArgumentNullException(nameof(target));
             if (eventName == null)
-                throw new ArgumentNullException("eventName");
+                throw new ArgumentNullException(nameof(eventName));
             if (scheduler == null)
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
 
             return s_impl.FromEventPattern(target, eventName, scheduler);
         }
@@ -812,9 +812,9 @@ namespace System.Reactive.Linq
         public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName)
         {
             if (type == null)
-                throw new ArgumentNullException("type");
+                throw new ArgumentNullException(nameof(type));
             if (eventName == null)
-                throw new ArgumentNullException("eventName");
+                throw new ArgumentNullException(nameof(eventName));
 
             return s_impl.FromEventPattern(type, eventName);
         }
@@ -862,11 +862,11 @@ namespace System.Reactive.Linq
         public static IObservable<EventPattern<EventArgs>> FromEventPattern(Type type, string eventName, IScheduler scheduler)
         {
             if (type == null)
-                throw new ArgumentNullException("type");
+                throw new ArgumentNullException(nameof(type));
             if (eventName == null)
-                throw new ArgumentNullException("eventName");
+                throw new ArgumentNullException(nameof(eventName));
             if (scheduler == null)
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
 
             return s_impl.FromEventPattern(type, eventName, scheduler);
         }

Файловите разлики са ограничени, защото са твърде много
+ 203 - 203
Rx.NET/Source/src/System.Reactive/Linq/Qbservable.Generated.cs


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

@@ -41,9 +41,9 @@ namespace System.Reactive.Linq
         public static IQbservable<Unit> Create(this IQbservableProvider provider, Expression<Func<IEnumerable<IObservable<object>>>> iteratorMethod)
         {
             if (provider == null)
-                throw new ArgumentNullException("provider");
+                throw new ArgumentNullException(nameof(provider));
             if (iteratorMethod == null)
-                throw new ArgumentNullException("iteratorMethod");
+                throw new ArgumentNullException(nameof(iteratorMethod));
             
             return provider.CreateQuery<Unit>(
                 Expression.Call(
@@ -74,9 +74,9 @@ namespace System.Reactive.Linq
         public static IQbservable<TResult> Create<TResult>(this IQbservableProvider provider, Expression<Func<IObserver<TResult>, IEnumerable<IObservable<object>>>> iteratorMethod)
         {
             if (provider == null)
-                throw new ArgumentNullException("provider");
+                throw new ArgumentNullException(nameof(provider));
             if (iteratorMethod == null)
-                throw new ArgumentNullException("iteratorMethod");
+                throw new ArgumentNullException(nameof(iteratorMethod));
             
             return provider.CreateQuery<TResult>(
                 Expression.Call(
@@ -107,9 +107,9 @@ namespace System.Reactive.Linq
         public static IQbservable<TSource> Expand<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TSource>>> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
             
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
@@ -141,11 +141,11 @@ namespace System.Reactive.Linq
         public static IQbservable<TSource> Expand<TSource>(this IQbservable<TSource> source, Expression<Func<TSource, IObservable<TSource>>> selector, IScheduler scheduler)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
             if (scheduler == null)
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
             
             return source.Provider.CreateQuery<TSource>(
                 Expression.Call(
@@ -177,9 +177,9 @@ namespace System.Reactive.Linq
         public static IQbservable<TSource[]> ForkJoin<TSource>(this IQbservableProvider provider, params IObservable<TSource>[] sources)
         {
             if (provider == null)
-                throw new ArgumentNullException("provider");
+                throw new ArgumentNullException(nameof(provider));
             if (sources == null)
-                throw new ArgumentNullException("sources");
+                throw new ArgumentNullException(nameof(sources));
             
             return provider.CreateQuery<TSource[]>(
                 Expression.Call(
@@ -210,9 +210,9 @@ namespace System.Reactive.Linq
         public static IQbservable<TSource[]> ForkJoin<TSource>(this IQbservableProvider provider, IEnumerable<IObservable<TSource>> sources)
         {
             if (provider == null)
-                throw new ArgumentNullException("provider");
+                throw new ArgumentNullException(nameof(provider));
             if (sources == null)
-                throw new ArgumentNullException("sources");
+                throw new ArgumentNullException(nameof(sources));
             
             return provider.CreateQuery<TSource[]>(
                 Expression.Call(
@@ -246,11 +246,11 @@ namespace System.Reactive.Linq
         public static IQbservable<TResult> ForkJoin<TSource1, TSource2, TResult>(this IQbservable<TSource1> first, IObservable<TSource2> second, Expression<Func<TSource1, TSource2, TResult>> resultSelector)
         {
             if (first == null)
-                throw new ArgumentNullException("first");
+                throw new ArgumentNullException(nameof(first));
             if (second == null)
-                throw new ArgumentNullException("second");
+                throw new ArgumentNullException(nameof(second));
             if (resultSelector == null)
-                throw new ArgumentNullException("resultSelector");
+                throw new ArgumentNullException(nameof(resultSelector));
             
             return first.Provider.CreateQuery<TResult>(
                 Expression.Call(
@@ -284,9 +284,9 @@ namespace System.Reactive.Linq
         public static IQbservable<TResult> Let<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, IObservable<TResult>>> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
             
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
@@ -311,9 +311,9 @@ namespace System.Reactive.Linq
         public static IQbservable<TResult> ManySelect<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, TResult>> selector)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
             
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(
@@ -338,11 +338,11 @@ namespace System.Reactive.Linq
         public static IQbservable<TResult> ManySelect<TSource, TResult>(this IQbservable<TSource> source, Expression<Func<IObservable<TSource>, TResult>> selector, IScheduler scheduler)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (selector == null)
-                throw new ArgumentNullException("selector");
+                throw new ArgumentNullException(nameof(selector));
             if (scheduler == null)
-                throw new ArgumentNullException("scheduler");
+                throw new ArgumentNullException(nameof(scheduler));
             
             return source.Provider.CreateQuery<TResult>(
                 Expression.Call(

+ 6 - 6
Rx.NET/Source/src/System.Reactive/Platforms/Windows/Concurrency/CoreDispatcherScheduler.cs

@@ -32,7 +32,7 @@ namespace System.Reactive.Concurrency
         public CoreDispatcherScheduler(CoreDispatcher dispatcher)
         {
             if (dispatcher == null)
-                throw new ArgumentNullException("dispatcher");
+                throw new ArgumentNullException(nameof(dispatcher));
 
             _dispatcher = dispatcher;
             _priority = CoreDispatcherPriority.Normal;
@@ -47,7 +47,7 @@ namespace System.Reactive.Concurrency
         public CoreDispatcherScheduler(CoreDispatcher dispatcher, CoreDispatcherPriority priority)
         {
             if (dispatcher == null)
-                throw new ArgumentNullException("dispatcher");
+                throw new ArgumentNullException(nameof(dispatcher));
 
             _dispatcher = dispatcher;
             _priority = priority;
@@ -95,7 +95,7 @@ namespace System.Reactive.Concurrency
         public override IDisposable Schedule<TState>(TState state, Func<IScheduler, TState, IDisposable> action)
         {
             if (action == null)
-                throw new ArgumentNullException("action");
+                throw new ArgumentNullException(nameof(action));
 
             var d = new SingleAssignmentDisposable();
 
@@ -151,7 +151,7 @@ namespace System.Reactive.Concurrency
         public override IDisposable Schedule<TState>(TState state, TimeSpan dueTime, Func<IScheduler, TState, IDisposable> action)
         {
             if (action == null)
-                throw new ArgumentNullException("action");
+                throw new ArgumentNullException(nameof(action));
 
             var dt = Scheduler.Normalize(dueTime);
             if (dt.Ticks == 0)
@@ -211,9 +211,9 @@ namespace System.Reactive.Concurrency
             // Empirical observation - negative values seem to be normalized to TimeSpan.Zero, but let's not go there.
             //
             if (period < TimeSpan.Zero)
-                throw new ArgumentOutOfRangeException("period");
+                throw new ArgumentOutOfRangeException(nameof(period));
             if (action == null)
-                throw new ArgumentNullException("action");
+                throw new ArgumentNullException(nameof(action));
 
             var timer = new DispatcherTimer();
 

+ 20 - 20
Rx.NET/Source/src/System.Reactive/Platforms/Windows/Linq/CoreDispatcherObservable.cs

@@ -28,9 +28,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dispatcher == null)
-                throw new ArgumentNullException("dispatcher");
+                throw new ArgumentNullException(nameof(dispatcher));
 
             return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dispatcher));
         }
@@ -47,9 +47,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dispatcher == null)
-                throw new ArgumentNullException("dispatcher");
+                throw new ArgumentNullException(nameof(dispatcher));
 
             return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dispatcher, priority));
         }
@@ -65,9 +65,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dependencyObject == null)
-                throw new ArgumentNullException("dependencyObject");
+                throw new ArgumentNullException(nameof(dependencyObject));
 
             return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher));
         }
@@ -84,9 +84,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> ObserveOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dependencyObject == null)
-                throw new ArgumentNullException("dependencyObject");
+                throw new ArgumentNullException(nameof(dependencyObject));
 
             return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher, priority));
         }
@@ -101,7 +101,7 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> ObserveOnDispatcher<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return Synchronization.ObserveOn(source, CoreDispatcherScheduler.Current);
         }
@@ -117,7 +117,7 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> ObserveOnDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return Synchronization.ObserveOn(source, new CoreDispatcherScheduler(CoreDispatcherScheduler.Current.Dispatcher, priority));
         }
@@ -141,9 +141,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dispatcher == null)
-                throw new ArgumentNullException("dispatcher");
+                throw new ArgumentNullException(nameof(dispatcher));
 
             return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher));
         }
@@ -164,9 +164,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, CoreDispatcher dispatcher, CoreDispatcherPriority priority)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dispatcher == null)
-                throw new ArgumentNullException("dispatcher");
+                throw new ArgumentNullException(nameof(dispatcher));
 
             return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dispatcher, priority));
         }
@@ -186,9 +186,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dependencyObject == null)
-                throw new ArgumentNullException("dependencyObject");
+                throw new ArgumentNullException(nameof(dependencyObject));
 
             return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher));
         }
@@ -209,9 +209,9 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SubscribeOn<TSource>(this IObservable<TSource> source, DependencyObject dependencyObject, CoreDispatcherPriority priority)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
             if (dependencyObject == null)
-                throw new ArgumentNullException("dependencyObject");
+                throw new ArgumentNullException(nameof(dependencyObject));
 
             return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(dependencyObject.Dispatcher, priority));
         }
@@ -230,7 +230,7 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SubscribeOnDispatcher<TSource>(this IObservable<TSource> source)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return Synchronization.SubscribeOn(source, CoreDispatcherScheduler.Current);
         }
@@ -250,7 +250,7 @@ namespace System.Reactive.Linq
         public static IObservable<TSource> SubscribeOnDispatcher<TSource>(this IObservable<TSource> source, CoreDispatcherPriority priority)
         {
             if (source == null)
-                throw new ArgumentNullException("source");
+                throw new ArgumentNullException(nameof(source));
 
             return Synchronization.SubscribeOn(source, new CoreDispatcherScheduler(CoreDispatcherScheduler.Current.Dispatcher, priority));
         }

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

@@ -5,7 +5,6 @@
 using System.Reactive.Disposables;
 using System.Threading;
 using System.Runtime.CompilerServices;
-using System.Reactive.Concurrency;
 
 namespace System.Reactive.Subjects
 {

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

@@ -300,7 +300,7 @@ namespace System.Reactive.Subjects
         public void OnError(Exception error)
         {
             if (error == null)
-                throw new ArgumentNullException("error");
+                throw new ArgumentNullException(nameof(error));
 
             var os = default(IObserver<T>[]);
             lock (gate)
@@ -352,7 +352,7 @@ namespace System.Reactive.Subjects
         public IDisposable Subscribe(IObserver<T> observer)
         {
             if (observer == null)
-                throw new ArgumentNullException("observer");
+                throw new ArgumentNullException(nameof(observer));
 
             lock (gate)
             {

+ 3 - 4
Rx.NET/Source/src/System.Reactive/Subjects/SubjectBase.cs

@@ -1,7 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
+// 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. 
 
 namespace System.Reactive.Subjects
 {

Някои файлове не бяха показани, защото твърде много файлове са промени