Prechádzať zdrojové kódy

Merge pull request #754 from danielcweber/FixAllCapsNames

Fix those ugly all-caps names.
Daniel C. Weber 7 rokov pred
rodič
commit
13db7600dd

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

@@ -57,7 +57,7 @@ namespace System.Reactive.Concurrency
         /// </summary>
         [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Justification = "Now marked as obsolete.")]
         [EditorBrowsable(EditorBrowsableState.Never)]
-        [Obsolete(Constants_Core.OBSOLETE_SCHEDULEREQUIRED)] // Preferring static method call over instance method call.
+        [Obsolete(Constants_Core.ObsoleteSchedulerequired)] // Preferring static method call over instance method call.
         public bool ScheduleRequired => IsScheduleRequired;
 
         /// <summary>

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

@@ -14,7 +14,7 @@ namespace System.Reactive.Concurrency
         public DisableOptimizationsScheduler(IScheduler scheduler)
             : base(scheduler)
         {
-            _optimizationInterfaces = Scheduler.OPTIMIZATIONS;
+            _optimizationInterfaces = Scheduler.Optimizations;
         }
 
         public DisableOptimizationsScheduler(IScheduler scheduler, Type[] optimizationInterfaces)

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

@@ -61,7 +61,7 @@ namespace System.Reactive.Concurrency
         /// Threshold where an item is considered to be short term work or gets moved from
         /// long term to short term.
         /// </summary>
-        private static readonly TimeSpan SHORTTERM = TimeSpan.FromSeconds(10);
+        private static readonly TimeSpan ShortTerm = TimeSpan.FromSeconds(10);
 
         /// <summary>
         /// Maximum error ratio for timer drift. We've seen machines with 10s drift on a
@@ -79,14 +79,14 @@ namespace System.Reactive.Concurrency
         /// enough time to transition work to short term and as a courtesy to the
         /// destination scheduler to manage its queues etc.
         /// </summary>
-        private const int MAXERRORRATIO = 1000;
+        private const int MaxErrorRatio = 1000;
 
         /// <summary>
         /// Minimum threshold for the long term timer to fire before the queue is reevaluated
         /// for short term work. This value is chosen to be less than SHORTTERM in order to
         /// ensure the timer fires and has work to transition to the short term queue.
         /// </summary>
-        private static readonly TimeSpan LONGTOSHORT = TimeSpan.FromSeconds(5);
+        private static readonly TimeSpan LongToShort = TimeSpan.FromSeconds(5);
 
         /// <summary>
         /// Threshold used to determine when a short term timer has fired too early compared
@@ -94,12 +94,12 @@ namespace System.Reactive.Concurrency
         /// completion of scheduled work, which can happen in case of time adjustment in the
         /// operating system (cf. GetSystemTimeAdjustment).
         /// </summary>
-        private static readonly TimeSpan RETRYSHORT = TimeSpan.FromMilliseconds(50);
+        private static readonly TimeSpan RetryShort = TimeSpan.FromMilliseconds(50);
 
         /// <summary>
         /// Longest interval supported by timers in the BCL.
         /// </summary>
-        private static readonly TimeSpan MAXSUPPORTEDTIMER = TimeSpan.FromMilliseconds((1L << 32) - 2);
+        private static readonly TimeSpan MaxSupportedTimer = TimeSpan.FromMilliseconds((1L << 32) - 2);
 
         /// <summary>
         /// Creates a new local scheduler.
@@ -153,7 +153,7 @@ namespace System.Reactive.Concurrency
 
             var workItem = new WorkItem<TState>(this, state, dueTime, action);
 
-            if (due <= SHORTTERM)
+            if (due <= ShortTerm)
             {
                 ScheduleShortTermWork(workItem);
             }
@@ -242,7 +242,7 @@ namespace System.Reactive.Concurrency
                 // have only "little" impact (range of 100s of ms). On an absolute time scale, we
                 // don't provide stronger guarantees.
                 //
-                if (next.DueTime - next.Scheduler.Now >= RETRYSHORT)
+                if (next.DueTime - next.Scheduler.Now >= RetryShort)
                 {
                     ScheduleShortTermWork(next);
                 }
@@ -324,13 +324,13 @@ namespace System.Reactive.Concurrency
                 // error due to drift is negligible.
                 //
                 var due = Scheduler.Normalize(next.DueTime - next.Scheduler.Now);
-                var remainder = TimeSpan.FromTicks(Math.Max(due.Ticks / MAXERRORRATIO, LONGTOSHORT.Ticks));
+                var remainder = TimeSpan.FromTicks(Math.Max(due.Ticks / MaxErrorRatio, LongToShort.Ticks));
                 var dueEarly = due - remainder;
 
                 //
                 // Limit the interval to maximum supported by underlying Timer.
                 //
-                var dueCapped = TimeSpan.FromTicks(Math.Min(dueEarly.Ticks, MAXSUPPORTEDTIMER.Ticks));
+                var dueCapped = TimeSpan.FromTicks(Math.Min(dueEarly.Ticks, MaxSupportedTimer.Ticks));
 
                 _nextLongTermWorkItem = next;
                 _nextLongTermTimer.Disposable = ConcurrencyAbstractionLayer.Current.StartTimer(_ => EvaluateLongTermQueue(), null, dueCapped);
@@ -352,7 +352,7 @@ namespace System.Reactive.Concurrency
                     next = _longTerm.Peek();
 
                     var due = Scheduler.Normalize(next.DueTime - next.Scheduler.Now);
-                    if (due >= SHORTTERM)
+                    if (due >= ShortTerm)
                     {
                         break;
                     }

+ 21 - 21
Rx.NET/Source/src/System.Reactive/Concurrency/Scheduler.Services.Emulation.cs

@@ -330,7 +330,7 @@ namespace System.Reactive.Concurrency
                 _stopwatchProvider = stopwatchProvider;
 
                 _state = state;
-                _runState = STOPPED;
+                _runState = Stopped;
             }
 
             private TState _state;
@@ -362,10 +362,10 @@ namespace System.Reactive.Concurrency
             //  (d) Dispose returned object from Start --> scheduled work is cancelled
             //  (e) Dispose returned object from Start --> unblocks _resumeEvent, Tick exits
             //
-            private const int STOPPED = 0;
-            private const int RUNNING = 1;
-            private const int SUSPENDED = 2;
-            private const int DISPOSED = 3;
+            private const int Stopped = 0;
+            private const int Running = 1;
+            private const int Suspended = 2;
+            private const int Disposed = 3;
 
             private IDisposable _task;
 
@@ -375,7 +375,7 @@ namespace System.Reactive.Concurrency
 
                 _stopwatch = _stopwatchProvider.StartStopwatch();
                 _nextDue = _period;
-                _runState = RUNNING;
+                _runState = Running;
 
                 Disposable.TrySetSingle(ref _task, _scheduler.Schedule(this, _nextDue, (@this, a) => @this.Tick(a)));
                 return this;
@@ -398,7 +398,7 @@ namespace System.Reactive.Concurrency
                 {
                     lock (_gate)
                     {
-                        if (_runState == RUNNING)
+                        if (_runState == Running)
                         {
                             //
                             // This is the fast path. We just let the stopwatch continue to
@@ -410,7 +410,7 @@ namespace System.Reactive.Concurrency
                             break;
                         }
 
-                        if (_runState == DISPOSED)
+                        if (_runState == Disposed)
                         {
                             //
                             // In case the periodic job gets disposed but we are currently
@@ -427,7 +427,7 @@ namespace System.Reactive.Concurrency
                         // to block such that future reevaluations of the next due time
                         // will pick up the cumulative inactive time delta.
                         //
-                        Debug.Assert(_runState == SUSPENDED);
+                        Debug.Assert(_runState == Suspended);
                     }
 
                     //
@@ -449,7 +449,7 @@ namespace System.Reactive.Concurrency
 
                 lock (_gate)
                 {
-                    _runState = DISPOSED;
+                    _runState = Disposed;
 
                     if (!Environment.HasShutdownStarted)
                     {
@@ -476,10 +476,10 @@ namespace System.Reactive.Concurrency
                 //
                 lock (_gate)
                 {
-                    if (_runState == RUNNING)
+                    if (_runState == Running)
                     {
                         _suspendedAt = _stopwatch.Elapsed;
-                        _runState = SUSPENDED;
+                        _runState = Suspended;
 
                         if (!Environment.HasShutdownStarted)
                         {
@@ -510,10 +510,10 @@ namespace System.Reactive.Concurrency
                 //
                 lock (_gate)
                 {
-                    if (_runState == SUSPENDED)
+                    if (_runState == Suspended)
                     {
                         _inactiveTime += _stopwatch.Elapsed - _suspendedAt;
-                        _runState = RUNNING;
+                        _runState = Running;
 
                         if (!Environment.HasShutdownStarted)
                         {
@@ -573,8 +573,8 @@ namespace System.Reactive.Concurrency
             // The protocol using the three commands is explained in the Tick implementation below.
             //
             private const int TICK = 0;
-            private const int DISPATCH_START = 1;
-            private const int DISPATCH_END = 2;
+            private const int DispatchStart = 1;
+            private const int DispatchEnd = 2;
 
             private void Tick(int command, Action<int, TimeSpan> recurse)
             {
@@ -596,12 +596,12 @@ namespace System.Reactive.Concurrency
                         //
                         if (Interlocked.Increment(ref _pendingTickCount) == 1)
                         {
-                            goto case DISPATCH_START;
+                            goto case DispatchStart;
                         }
 
                         break;
 
-                    case DISPATCH_START:
+                    case DispatchStart:
                         try
                         {
                             _state = _action(_state);
@@ -625,11 +625,11 @@ namespace System.Reactive.Concurrency
                         // disabled using DisableOptimizations; legacy implementations of schedulers
                         // from the v1.x days will not have a stopwatch).
                         //
-                        recurse(DISPATCH_END, TimeSpan.Zero);
+                        recurse(DispatchEnd, TimeSpan.Zero);
 
                         break;
 
-                    case DISPATCH_END:
+                    case DispatchEnd:
                         //
                         // If work was due while we were still running user code, the count will have
                         // been incremented by the periodic tick handler above. In that case, we will
@@ -642,7 +642,7 @@ namespace System.Reactive.Concurrency
                         //
                         if (Interlocked.Decrement(ref _pendingTickCount) > 0)
                         {
-                            recurse(DISPATCH_START, TimeSpan.Zero);
+                            recurse(DispatchStart, TimeSpan.Zero);
                         }
 
                         break;

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

@@ -10,7 +10,7 @@ namespace System.Reactive.Concurrency
     //
     public static partial class Scheduler
     {
-        internal static Type[] OPTIMIZATIONS = {
+        internal static Type[] Optimizations = {
             typeof(ISchedulerLongRunning),
             typeof(IStopwatchProvider),
             typeof(ISchedulerPeriodic)

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

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

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

@@ -9,18 +9,18 @@ namespace System.Reactive.Concurrency
 {
     internal static class TaskHelpers
     {
-        private const int MAX_DELAY = int.MaxValue;
+        private const int MaxDelay = int.MaxValue;
 
         public static Task Delay(TimeSpan delay, CancellationToken token)
         {
             var milliseconds = (long)delay.TotalMilliseconds;
 
-            if (milliseconds > MAX_DELAY)
+            if (milliseconds > MaxDelay)
             {
-                var remainder = delay - TimeSpan.FromMilliseconds(MAX_DELAY);
+                var remainder = delay - TimeSpan.FromMilliseconds(MaxDelay);
 
                 return
-                    Task.Delay(MAX_DELAY, token)
+                    Task.Delay(MaxDelay, token)
                         .ContinueWith(_ => Delay(remainder, token), TaskContinuationOptions.ExecuteSynchronously)
                         .Unwrap();
             }

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

@@ -18,11 +18,11 @@ namespace System.Reactive.Disposables
         private bool _disposed;
         private List<IDisposable> _disposables;
         private int _count;
-        private const int SHRINK_THRESHOLD = 64;
+        private const int ShrinkThreshold = 64;
 
         // Default initial capacity of the _disposables list in case
         // The number of items is not known upfront
-        private const int DEFAULT_CAPACITY = 16;
+        private const int DefaultCapacity = 16;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="CompositeDisposable"/> class with no disposables contained by it initially.
@@ -85,7 +85,7 @@ namespace System.Reactive.Disposables
             else
             {
                 // Unknown sized disposables, use the default capacity hint
-                Init(disposables, DEFAULT_CAPACITY);
+                Init(disposables, DefaultCapacity);
             }
         }
 
@@ -190,7 +190,7 @@ namespace System.Reactive.Disposables
 
                 current[i] = null;
 
-                if (current.Capacity > SHRINK_THRESHOLD && _count < current.Capacity / 2)
+                if (current.Capacity > ShrinkThreshold && _count < current.Capacity / 2)
                 {
                     var fresh = new List<IDisposable>(current.Capacity / 2);
 
@@ -357,7 +357,7 @@ namespace System.Reactive.Disposables
             {
                 if (_disposed || _count == 0)
                 {
-                    return EMPTY_ENUMERATOR;
+                    return EmptyEnumerator;
                 }
                 // the copy is unavoidable but the creation
                 // of an outer IEnumerable is avoidable
@@ -380,7 +380,7 @@ namespace System.Reactive.Disposables
         /// An empty enumerator for the <see cref="GetEnumerator"/>
         /// method to avoid allocation on disposed or empty composites.
         /// </summary>
-        private static readonly CompositeEnumerator EMPTY_ENUMERATOR =
+        private static readonly CompositeEnumerator EmptyEnumerator =
             new CompositeEnumerator(new IDisposable[0]);
 
         /// <summary>

+ 9 - 9
Rx.NET/Source/src/System.Reactive/Internal/CheckedObserver.cs

@@ -11,9 +11,9 @@ namespace System.Reactive
         private readonly IObserver<T> _observer;
         private int _state;
 
-        private const int IDLE = 0;
-        private const int BUSY = 1;
-        private const int DONE = 2;
+        private const int Idle = 0;
+        private const int Busy = 1;
+        private const int Done = 2;
 
         public CheckedObserver(IObserver<T> observer)
         {
@@ -30,7 +30,7 @@ namespace System.Reactive
             }
             finally
             {
-                Interlocked.Exchange(ref _state, IDLE);
+                Interlocked.Exchange(ref _state, Idle);
             }
         }
 
@@ -44,7 +44,7 @@ namespace System.Reactive
             }
             finally
             {
-                Interlocked.Exchange(ref _state, DONE);
+                Interlocked.Exchange(ref _state, Done);
             }
         }
 
@@ -58,17 +58,17 @@ namespace System.Reactive
             }
             finally
             {
-                Interlocked.Exchange(ref _state, DONE);
+                Interlocked.Exchange(ref _state, Done);
             }
         }
 
         private void CheckAccess()
         {
-            switch (Interlocked.CompareExchange(ref _state, BUSY, IDLE))
+            switch (Interlocked.CompareExchange(ref _state, Busy, Idle))
             {
-                case BUSY:
+                case Busy:
                     throw new InvalidOperationException(Strings_Core.REENTRANCY_DETECTED);
-                case DONE:
+                case Done:
                     throw new InvalidOperationException(Strings_Core.OBSERVER_TERMINATED);
             }
         }

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

@@ -8,13 +8,13 @@ namespace System.Reactive
 
     internal static class Constants_Core
     {
-        private const string OBSOLETE_REFACTORING = "This property is no longer supported due to refactoring of the API surface and elimination of platform-specific dependencies.";
+        private const string ObsoleteRefactoring = "This property is no longer supported due to refactoring of the API surface and elimination of platform-specific dependencies.";
 
-        public const string OBSOLETE_SCHEDULER_NEWTHREAD = OBSOLETE_REFACTORING + " Please use NewThreadScheduler.Default to obtain an instance of this scheduler type.";
-        public const string OBSOLETE_SCHEDULER_TASKPOOL = OBSOLETE_REFACTORING + " Please use TaskPoolScheduler.Default to obtain an instance of this scheduler type.";
-        public const string OBSOLETE_SCHEDULER_THREADPOOL = OBSOLETE_REFACTORING + " Consider using Scheduler.Default to obtain the platform's most appropriate pool-based scheduler. In order to access a specific pool-based scheduler, please add a reference to the System.Reactive.PlatformServices assembly for your target platform and use the appropriate scheduler in the System.Reactive.Concurrency namespace.";
+        public const string ObsoleteSchedulerNewthread = ObsoleteRefactoring + " Please use NewThreadScheduler.Default to obtain an instance of this scheduler type.";
+        public const string ObsoleteSchedulerTaskpool = ObsoleteRefactoring + " Please use TaskPoolScheduler.Default to obtain an instance of this scheduler type.";
+        public const string ObsoleteSchedulerThreadpool = ObsoleteRefactoring + " Consider using Scheduler.Default to obtain the platform's most appropriate pool-based scheduler. In order to access a specific pool-based scheduler, please add a reference to the System.Reactive.PlatformServices assembly for your target platform and use the appropriate scheduler in the System.Reactive.Concurrency namespace.";
 
-        public const string OBSOLETE_SCHEDULEREQUIRED = "This instance property is no longer supported. Use CurrentThreadScheduler.IsScheduleRequired instead.";
+        public const string ObsoleteSchedulerequired = "This instance property is no longer supported. Use CurrentThreadScheduler.IsScheduleRequired instead.";
     }
 
     // We can't make those based on the Strings_*.resx file, because the ObsoleteAttribute needs a compile-time constant.
@@ -22,8 +22,8 @@ namespace System.Reactive
     internal static class Constants_Linq
     {
 #if PREFER_ASYNC
-        public const string USE_ASYNC = "This blocking operation is no longer supported. Instead, use the async version in combination with C# and Visual Basic async/await support. In case you need a blocking operation, use Wait or convert the resulting observable sequence to a Task object and block.";
-        public const string USE_TASK_FROMASYNCPATTERN = "This conversion is no longer supported. Replace use of the Begin/End asynchronous method pair with a new Task-based async method, and convert the result using ToObservable. If no Task-based async method is available, use Task.Factory.FromAsync to obtain a Task object.";
+        public const string UseAsync = "This blocking operation is no longer supported. Instead, use the async version in combination with C# and Visual Basic async/await support. In case you need a blocking operation, use Wait or convert the resulting observable sequence to a Task object and block.";
+        public const string UseTaskFromAsyncPattern = "This conversion is no longer supported. Replace use of the Begin/End asynchronous method pair with a new Task-based async method, and convert the result using ToObservable. If no Task-based async method is available, use Task.Factory.FromAsync to obtain a Task object.";
 #endif
     }
 }

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

@@ -14,10 +14,10 @@ namespace System.Reactive
     internal class ScheduledObserver<T> : ObserverBase<T>, IScheduledObserver<T>
     {
         private int _state;
-        private const int STOPPED = 0;
-        private const int RUNNING = 1;
-        private const int PENDING = 2;
-        private const int FAULTED = 9;
+        private const int Stopped = 0;
+        private const int Running = 1;
+        private const int Pending = 2;
+        private const int Faulted = 9;
         private readonly ConcurrentQueue<T> _queue = new ConcurrentQueue<T>();
         private bool _failed;
         private Exception _error;
@@ -156,14 +156,14 @@ namespace System.Reactive
 
             while (true)
             {
-                var old = Interlocked.CompareExchange(ref _state, RUNNING, STOPPED);
-                if (old == STOPPED)
+                var old = Interlocked.CompareExchange(ref _state, Running, Stopped);
+                if (old == Stopped)
                 {
                     isOwner = true; // RUNNING
                     break;
                 }
 
-                if (old == FAULTED)
+                if (old == Faulted)
                 {
                     return;
                 }
@@ -191,7 +191,7 @@ namespace System.Reactive
                 // should only be called after invocation of IObserver<T> methods that touch
                 // this state.
                 //
-                if (old == PENDING || old == RUNNING && Interlocked.CompareExchange(ref _state, PENDING, RUNNING) == RUNNING)
+                if (old == Pending || old == Running && Interlocked.CompareExchange(ref _state, Pending, Running) == Running)
                 {
                     break;
                 }
@@ -229,7 +229,7 @@ namespace System.Reactive
                         continue;
                     }
 
-                    Interlocked.Exchange(ref _state, STOPPED);
+                    Interlocked.Exchange(ref _state, Stopped);
                     _observer.OnError(_error);
                     Dispose();
                     return;
@@ -256,26 +256,26 @@ namespace System.Reactive
                         continue;
                     }
 
-                    Interlocked.Exchange(ref _state, STOPPED);
+                    Interlocked.Exchange(ref _state, Stopped);
                     _observer.OnCompleted();
                     Dispose();
                     return;
                 }
 
-                var old = Interlocked.CompareExchange(ref _state, STOPPED, RUNNING);
-                if (old == RUNNING || old == FAULTED)
+                var old = Interlocked.CompareExchange(ref _state, Stopped, Running);
+                if (old == Running || old == Faulted)
                 {
                     return;
                 }
 
-                Debug.Assert(old == PENDING);
+                Debug.Assert(old == Pending);
 
                 // The producer has put us in the PENDING state to prevent us from
                 // transitioning to STOPPED, so we go RUNNING again and re-check our state.
-                _state = RUNNING;
+                _state = Running;
             }
 
-            Interlocked.Exchange(ref _state, RUNNING);
+            Interlocked.Exchange(ref _state, Running);
 
             try
             {
@@ -283,7 +283,7 @@ namespace System.Reactive
             }
             catch
             {
-                Interlocked.Exchange(ref _state, FAULTED);
+                Interlocked.Exchange(ref _state, Faulted);
 
                 while (_queue.TryDequeue(out _))
                 {

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

@@ -24,10 +24,10 @@ namespace System.Reactive.PlatformServices
 
     internal class DefaultSystemClockMonitor : PeriodicTimerSystemClockMonitor
     {
-        private static readonly TimeSpan DEFAULT_PERIOD = TimeSpan.FromSeconds(1);
+        private static readonly TimeSpan DefaultPeriod = TimeSpan.FromSeconds(1);
 
         public DefaultSystemClockMonitor()
-            : base(DEFAULT_PERIOD)
+            : base(DefaultPeriod)
         {
         }
     }
@@ -49,9 +49,9 @@ namespace System.Reactive.PlatformServices
 
         private EventHandler<SystemClockChangedEventArgs> _systemClockChanged;
 
-        private const int SYNC_MAXRETRIES = 100;
-        private const double SYNC_MAXDELTA = 10;
-        private const int MAXERROR = 100;
+        private const int SyncMaxRetries = 100;
+        private const double SyncMaxDelta = 10;
+        private const int MaxError = 100;
 
         /// <summary>
         /// Creates a new monitor for system clock changes with the specified polling frequency.
@@ -94,7 +94,7 @@ namespace System.Reactive.PlatformServices
 
                 Disposable.TrySetSerial(ref _timer, ConcurrencyAbstractionLayer.Current.StartPeriodicTimer(TimeChanged, _period));
 
-                if (Math.Abs(SystemClock.UtcNow.ToUnixTimeMilliseconds() - now) <= SYNC_MAXDELTA)
+                if (Math.Abs(SystemClock.UtcNow.ToUnixTimeMilliseconds() - now) <= SyncMaxDelta)
                 {
                     break;
                 }
@@ -102,9 +102,9 @@ namespace System.Reactive.PlatformServices
                 {
                     break;
                 }
-                if (++n >= SYNC_MAXRETRIES)
+                if (++n >= SyncMaxRetries)
                 {
-                    Task.Delay((int)SYNC_MAXDELTA).Wait();
+                    Task.Delay((int)SyncMaxDelta).Wait();
                 }
             };
         }
@@ -117,7 +117,7 @@ namespace System.Reactive.PlatformServices
 
             var oldTime = (long)(last + _period.TotalMilliseconds);
             var diff = now - oldTime;
-            if (Math.Abs(diff) >= MAXERROR)
+            if (Math.Abs(diff) >= MaxError)
             {
                 _systemClockChanged?.Invoke(this, new SystemClockChangedEventArgs(
                     DateTimeOffset.FromUnixTimeMilliseconds(oldTime), newTime));

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

@@ -25,7 +25,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<IObservable<TResult>> FromAsyncPattern<TResult>(Func<AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -53,7 +53,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, IObservable<TResult>> FromAsyncPattern<TArg1, TResult>(Func<TArg1, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -82,7 +82,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TResult>(Func<TArg1, TArg2, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -112,7 +112,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TResult>(Func<TArg1, TArg2, TArg3, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -143,7 +143,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TResult>(Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -175,7 +175,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -208,7 +208,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -242,7 +242,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -277,7 +277,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -313,7 +313,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -350,7 +350,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -388,7 +388,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -427,7 +427,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -467,7 +467,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -508,7 +508,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<TResult>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, TResult>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, object, IAsyncResult> begin, Func<IAsyncResult, TResult> end)
         {
@@ -538,7 +538,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<IObservable<Unit>> FromAsyncPattern(Func<AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -565,7 +565,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, IObservable<Unit>> FromAsyncPattern<TArg1>(Func<TArg1, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -593,7 +593,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2>(Func<TArg1, TArg2, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -622,7 +622,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3>(Func<TArg1, TArg2, TArg3, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -652,7 +652,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4>(Func<TArg1, TArg2, TArg3, TArg4, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -683,7 +683,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -715,7 +715,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -748,7 +748,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -782,7 +782,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -817,7 +817,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -853,7 +853,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -890,7 +890,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -928,7 +928,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -967,7 +967,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {
@@ -1007,7 +1007,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="begin"/> or <paramref name="end"/> is null.</exception>
         /// <remarks>Each invocation of the resulting function will cause the asynchronous operation to be started. Subscription to the resulting sequence has no observable side-effect, and each subscription will produce the asynchronous operation's result.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_TASK_FROMASYNCPATTERN)]
+        [Obsolete(Constants_Linq.UseTaskFromAsyncPattern)]
 #endif
         public static Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, IObservable<Unit>> FromAsyncPattern<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14>(Func<TArg1, TArg2, TArg3, TArg4, TArg5, TArg6, TArg7, TArg8, TArg9, TArg10, TArg11, TArg12, TArg13, TArg14, AsyncCallback, object, IAsyncResult> begin, Action<IAsyncResult> end)
         {

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

@@ -111,7 +111,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">The source sequence is empty.</exception>
         /// <seealso cref="Observable.FirstAsync{TSource}(IObservable{TSource})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource First<TSource>(this IObservable<TSource> source)
         {
@@ -134,7 +134,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">No element satisfies the condition in the predicate. -or- The source sequence is empty.</exception>
         /// <seealso cref="Observable.FirstAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource First<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {
@@ -164,7 +164,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <seealso cref="Observable.FirstOrDefaultAsync{TSource}(IObservable{TSource})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource FirstOrDefault<TSource>(this IObservable<TSource> source)
         {
@@ -186,7 +186,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="predicate"/> is null.</exception>
         /// <seealso cref="Observable.FirstOrDefaultAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource FirstOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {
@@ -216,7 +216,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> is null.</exception>
         /// <remarks>Because of its blocking nature, this operator is mainly used for testing.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static void ForEach<TSource>(this IObservable<TSource> source, Action<TSource> onNext)
         {
@@ -242,7 +242,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="onNext"/> is null.</exception>
         /// <remarks>Because of its blocking nature, this operator is mainly used for testing.</remarks>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static void ForEach<TSource>(this IObservable<TSource> source, Action<TSource, int> onNext)
         {
@@ -294,7 +294,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">The source sequence is empty.</exception>
         /// <seealso cref="Observable.LastAsync{TSource}(IObservable{TSource})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource Last<TSource>(this IObservable<TSource> source)
         {
@@ -317,7 +317,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">No element satisfies the condition in the predicate. -or- The source sequence is empty.</exception>
         /// <seealso cref="Observable.LastAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource Last<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {
@@ -347,7 +347,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> is null.</exception>
         /// <seealso cref="Observable.LastOrDefaultAsync{TSource}(IObservable{TSource})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource LastOrDefault<TSource>(this IObservable<TSource> source)
         {
@@ -369,7 +369,7 @@ namespace System.Reactive.Linq
         /// <exception cref="ArgumentNullException"><paramref name="source"/> or <paramref name="predicate"/> is null.</exception>
         /// <seealso cref="Observable.LastOrDefaultAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource LastOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {
@@ -466,7 +466,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">The source sequence contains more than one element. -or- The source sequence is empty.</exception>
         /// <seealso cref="Observable.SingleAsync{TSource}(IObservable{TSource})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource Single<TSource>(this IObservable<TSource> source)
         {
@@ -489,7 +489,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">No element satisfies the condition in the predicate. -or- More than one element satisfies the condition in the predicate. -or- The source sequence is empty.</exception>
         /// <seealso cref="Observable.SingleAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource Single<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {
@@ -520,7 +520,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">The source sequence contains more than one element.</exception>
         /// <seealso cref="Observable.SingleOrDefaultAsync{TSource}(IObservable{TSource})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource SingleOrDefault<TSource>(this IObservable<TSource> source)
         {
@@ -543,7 +543,7 @@ namespace System.Reactive.Linq
         /// <exception cref="InvalidOperationException">The sequence contains more than one element that satisfies the condition in the predicate.</exception>
         /// <seealso cref="Observable.SingleOrDefaultAsync{TSource}(IObservable{TSource}, Func{TSource, bool})"/>
 #if PREFER_ASYNC
-        [Obsolete(Constants_Linq.USE_ASYNC)]
+        [Obsolete(Constants_Linq.UseAsync)]
 #endif
         public static TSource SingleOrDefault<TSource>(this IObservable<TSource> source, Func<TSource, bool> predicate)
         {

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

@@ -297,9 +297,9 @@ namespace System.Reactive.Linq.ObservableImpl
         // and blocking, but also the more expensive operations that require all locks become (e.g. table
         // resizing, ToArray, Count, etc). According to brief benchmarks that we ran, 4 seems like a good
         // compromise.
-        private const int DEFAULT_CONCURRENCY_MULTIPLIER = 4;
+        private const int DefaultConcurrencyMultiplier = 4;
 
-        private static int DefaultConcurrencyLevel => DEFAULT_CONCURRENCY_MULTIPLIER * Environment.ProcessorCount;
+        private static int DefaultConcurrencyLevel => DefaultConcurrencyMultiplier * Environment.ProcessorCount;
 
         private readonly ConcurrentDictionary<TKey, TValue> _map;
 

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

@@ -25,17 +25,17 @@ namespace System.Reactive.Subjects
         /// <summary>
         /// A pre-allocated empty array for the no-observers state.
         /// </summary>
-        private static readonly AsyncSubjectDisposable[] EMPTY = new AsyncSubjectDisposable[0];
+        private static readonly AsyncSubjectDisposable[] Empty = new AsyncSubjectDisposable[0];
 
         /// <summary>
         /// A pre-allocated empty array indicating the AsyncSubject has terminated
         /// </summary>
-        private static readonly AsyncSubjectDisposable[] TERMINATED = new AsyncSubjectDisposable[0];
+        private static readonly AsyncSubjectDisposable[] Terminated = new AsyncSubjectDisposable[0];
 
         /// <summary>
         /// A pre-allocated empty array indicating the AsyncSubject has terminated
         /// </summary>
-        private static readonly AsyncSubjectDisposable[] DISPOSED = new AsyncSubjectDisposable[0];
+        private static readonly AsyncSubjectDisposable[] Disposed = new AsyncSubjectDisposable[0];
 
         #endregion
 
@@ -46,7 +46,7 @@ namespace System.Reactive.Subjects
         /// </summary>
         public AsyncSubject()
         {
-            _observers = EMPTY;
+            _observers = Empty;
         }
 
         #endregion
@@ -61,7 +61,7 @@ namespace System.Reactive.Subjects
         /// <summary>
         /// Indicates whether the subject has been disposed.
         /// </summary>
-        public override bool IsDisposed => Volatile.Read(ref _observers) == DISPOSED;
+        public override bool IsDisposed => Volatile.Read(ref _observers) == Disposed;
 
         #endregion
 
@@ -77,17 +77,17 @@ namespace System.Reactive.Subjects
             for (; ; )
             {
                 var observers = Volatile.Read(ref _observers);
-                if (observers == DISPOSED)
+                if (observers == Disposed)
                 {
                     _exception = null;
                     ThrowDisposed();
                     break;
                 }
-                if (observers == TERMINATED)
+                if (observers == Terminated)
                 {
                     break;
                 }
-                if (Interlocked.CompareExchange(ref _observers, TERMINATED, observers) == observers)
+                if (Interlocked.CompareExchange(ref _observers, Terminated, observers) == observers)
                 {
                     var hasValue = _hasValue;
                     if (hasValue)
@@ -132,19 +132,19 @@ namespace System.Reactive.Subjects
             for (; ; )
             {
                 var observers = Volatile.Read(ref _observers);
-                if (observers == DISPOSED)
+                if (observers == Disposed)
                 {
                     _exception = null;
                     _value = default;
                     ThrowDisposed();
                     break;
                 }
-                if (observers == TERMINATED)
+                if (observers == Terminated)
                 {
                     break;
                 }
                 _exception = error;
-                if (Interlocked.CompareExchange(ref _observers, TERMINATED, observers) == observers)
+                if (Interlocked.CompareExchange(ref _observers, Terminated, observers) == observers)
                 {
                     foreach (var o in observers)
                     {
@@ -165,14 +165,14 @@ namespace System.Reactive.Subjects
         public override void OnNext(T value)
         {
             var observers = Volatile.Read(ref _observers);
-            if (observers == DISPOSED)
+            if (observers == Disposed)
             {
                 _value = default;
                 _exception = null;
                 ThrowDisposed();
                 return;
             }
-            if (observers == TERMINATED)
+            if (observers == Terminated)
             {
                 return;
             }
@@ -226,7 +226,7 @@ namespace System.Reactive.Subjects
             for (; ; )
             {
                 var a = Volatile.Read(ref _observers);
-                if (a == DISPOSED)
+                if (a == Disposed)
                 {
                     _value = default;
                     _exception = null;
@@ -234,7 +234,7 @@ namespace System.Reactive.Subjects
                     return true;
                 }
 
-                if (a == TERMINATED)
+                if (a == Terminated)
                 {
                     return false;
                 }
@@ -282,7 +282,7 @@ namespace System.Reactive.Subjects
                 var b = default(AsyncSubjectDisposable[]);
                 if (n == 1)
                 {
-                    b = EMPTY;
+                    b = Empty;
                 }
                 else
                 {
@@ -337,7 +337,7 @@ namespace System.Reactive.Subjects
         /// </summary>
         public override void Dispose()
         {
-            if (Interlocked.Exchange(ref _observers, DISPOSED) != DISPOSED)
+            if (Interlocked.Exchange(ref _observers, Disposed) != Disposed)
             {
                 _exception = null;
                 _value = default;
@@ -422,7 +422,7 @@ namespace System.Reactive.Subjects
         /// <summary>
         /// Gets whether the AsyncSubject has completed.
         /// </summary>
-        public bool IsCompleted => Volatile.Read(ref _observers) == TERMINATED;
+        public bool IsCompleted => Volatile.Read(ref _observers) == Terminated;
 
         /// <summary>
         /// Gets the last element of the subject, potentially blocking until the subject completes successfully or exceptionally.
@@ -432,7 +432,7 @@ namespace System.Reactive.Subjects
         [Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Justification = "Await pattern for C# and VB compilers.")]
         public T GetResult()
         {
-            if (Volatile.Read(ref _observers) != TERMINATED)
+            if (Volatile.Read(ref _observers) != Terminated)
             {
                 var e = new ManualResetEvent(initialState: false);
                 OnCompleted(() => e.Set(), originalContext: false);

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

@@ -18,9 +18,9 @@ namespace System.Reactive.Subjects
 
         private SubjectDisposable[] _observers;
         private Exception _exception;
-        private static readonly SubjectDisposable[] EMPTY = new SubjectDisposable[0];
-        private static readonly SubjectDisposable[] TERMINATED = new SubjectDisposable[0];
-        private static readonly SubjectDisposable[] DISPOSED = new SubjectDisposable[0];
+        private static readonly SubjectDisposable[] Empty = new SubjectDisposable[0];
+        private static readonly SubjectDisposable[] Terminated = new SubjectDisposable[0];
+        private static readonly SubjectDisposable[] Disposed = new SubjectDisposable[0];
 
         #endregion
 
@@ -31,7 +31,7 @@ namespace System.Reactive.Subjects
         /// </summary>
         public Subject()
         {
-            Volatile.Write(ref _observers, EMPTY);
+            Volatile.Write(ref _observers, Empty);
         }
 
         #endregion
@@ -52,7 +52,7 @@ namespace System.Reactive.Subjects
         /// <summary>
         /// Indicates whether the subject has been disposed.
         /// </summary>
-        public override bool IsDisposed => Volatile.Read(ref _observers) == DISPOSED;
+        public override bool IsDisposed => Volatile.Read(ref _observers) == Disposed;
 
         #endregion
 
@@ -73,17 +73,17 @@ namespace System.Reactive.Subjects
             for (; ; )
             {
                 var observers = Volatile.Read(ref _observers);
-                if (observers == DISPOSED)
+                if (observers == Disposed)
                 {
                     _exception = null;
                     ThrowDisposed();
                     break;
                 }
-                if (observers == TERMINATED)
+                if (observers == Terminated)
                 {
                     break;
                 }
-                if (Interlocked.CompareExchange(ref _observers, TERMINATED, observers) == observers)
+                if (Interlocked.CompareExchange(ref _observers, Terminated, observers) == observers)
                 {
                     foreach (var observer in observers)
                     {
@@ -109,18 +109,18 @@ namespace System.Reactive.Subjects
             for (; ; )
             {
                 var observers = Volatile.Read(ref _observers);
-                if (observers == DISPOSED)
+                if (observers == Disposed)
                 {
                     _exception = null;
                     ThrowDisposed();
                     break;
                 }
-                if (observers == TERMINATED)
+                if (observers == Terminated)
                 {
                     break;
                 }
                 _exception = error;
-                if (Interlocked.CompareExchange(ref _observers, TERMINATED, observers) == observers)
+                if (Interlocked.CompareExchange(ref _observers, Terminated, observers) == observers)
                 {
                     foreach (var observer in observers)
                     {
@@ -138,7 +138,7 @@ namespace System.Reactive.Subjects
         public override void OnNext(T value)
         {
             var observers = Volatile.Read(ref _observers);
-            if (observers == DISPOSED)
+            if (observers == Disposed)
             {
                 _exception = null;
                 ThrowDisposed();
@@ -171,13 +171,13 @@ namespace System.Reactive.Subjects
             for (; ; )
             {
                 var observers = Volatile.Read(ref _observers);
-                if (observers == DISPOSED)
+                if (observers == Disposed)
                 {
                     _exception = null;
                     ThrowDisposed();
                     break;
                 }
-                if (observers == TERMINATED)
+                if (observers == Terminated)
                 {
                     var ex = _exception;
                     if (ex != null)
@@ -229,7 +229,7 @@ namespace System.Reactive.Subjects
                 var b = default(SubjectDisposable[]);
                 if (n == 1)
                 {
-                    b = EMPTY;
+                    b = Empty;
                 }
                 else
                 {
@@ -279,7 +279,7 @@ namespace System.Reactive.Subjects
         /// </summary>
         public override void Dispose()
         {
-            Interlocked.Exchange(ref _observers, DISPOSED);
+            Interlocked.Exchange(ref _observers, Disposed);
             _exception = null;
         }