浏览代码

Merge pull request #376 from Reactive-Extensions/MiscBaseClassImprovements

Some improvements to core classes
Bart J.F. De Smet 8 年之前
父节点
当前提交
7bfd6c3729

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

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

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

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

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

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

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

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

+ 5 - 14
Rx.NET/Source/src/System.Reactive/EventPattern.cs

@@ -58,9 +58,9 @@ namespace System.Reactive
         /// <returns><c>true</c> if both <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event; otherwise, <c>false</c>.</returns>
         public bool Equals(EventPattern<TSender, TEventArgs> other)
         {
-            if (object.ReferenceEquals(null, other))
+            if (ReferenceEquals(null, other))
                 return false;
-            if (object.ReferenceEquals(this, other))
+            if (ReferenceEquals(this, other))
                 return true;
 
             return EqualityComparer<TSender>.Default.Equals(Sender, other.Sender) && EqualityComparer<TEventArgs>.Default.Equals(EventArgs, other.EventArgs);
@@ -71,10 +71,7 @@ namespace System.Reactive
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="EventPattern{TSender, TEventArgs}"/>.</param>
         /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="EventPattern{TSender, TEventArgs}"/>; otherwise, <c>false</c>.</returns>
-        public override bool Equals(object obj)
-        {
-            return Equals(obj as EventPattern<TSender, TEventArgs>);
-        }
+        public override bool Equals(object obj) => Equals(obj as EventPattern<TSender, TEventArgs>);
 
         /// <summary>
         /// Returns the hash code for the current <see cref="EventPattern{TSender, TEventArgs}"/> instance.
@@ -93,10 +90,7 @@ namespace System.Reactive
         /// <param name="first">The first <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
         /// <param name="second">The second <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
         /// <returns><c>true</c> if both <see cref="EventPattern{TSender, TEventArgs}"/> objects represent the same event; otherwise, <c>false</c>.</returns>
-        public static bool operator ==(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second)
-        {
-            return object.Equals(first, second);
-        }
+        public static bool operator ==(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second) => Equals(first, second);
 
         /// <summary>
         /// Determines whether two specified <see cref="EventPattern{TSender, TEventArgs}"/> objects represent a different event.
@@ -104,9 +98,6 @@ namespace System.Reactive
         /// <param name="first">The first <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
         /// <param name="second">The second <see cref="EventPattern{TSender, TEventArgs}"/> to compare, or <c>null</c>.</param>
         /// <returns><c>true</c> if both <see cref="EventPattern{TSender, TEventArgs}"/> objects don't represent the same event; otherwise, <c>false</c>.</returns>
-        public static bool operator !=(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second)
-        {
-            return !object.Equals(first, second);
-        }
+        public static bool operator !=(EventPattern<TSender, TEventArgs> first, EventPattern<TSender, TEventArgs> second) => !Equals(first, second);
     }
 }

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

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

+ 16 - 8
Rx.NET/Source/src/System.Reactive/EventPatternSourceBase.cs

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

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

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

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

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

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

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

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

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

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

@@ -119,12 +119,13 @@ namespace System.Reactive
             /// </summary>
             public override bool Equals(Notification<T> other)
             {
-                if (Object.ReferenceEquals(this, other))
+                if (ReferenceEquals(this, other))
                     return true;
-                if (Object.ReferenceEquals(other, null))
+                if (ReferenceEquals(other, null))
                     return false;
                 if (other.Kind != NotificationKind.OnNext)
                     return false;
+
                 return EqualityComparer<T>.Default.Equals(Value, other.Value);
             }
 
@@ -245,13 +246,14 @@ namespace System.Reactive
             /// </summary>
             public override bool Equals(Notification<T> other)
             {
-                if (Object.ReferenceEquals(this, other))
+                if (ReferenceEquals(this, other))
                     return true;
-                if (Object.ReferenceEquals(other, null))
+                if (ReferenceEquals(other, null))
                     return false;
                 if (other.Kind != NotificationKind.OnError)
                     return false;
-                return Object.Equals(Exception, other.Exception);
+
+                return Equals(Exception, other.Exception);
             }
 
             /// <summary>
@@ -370,10 +372,11 @@ namespace System.Reactive
             /// </summary>
             public override bool Equals(Notification<T> other)
             {
-                if (Object.ReferenceEquals(this, other))
+                if (ReferenceEquals(this, other))
                     return true;
-                if (Object.ReferenceEquals(other, null))
+                if (ReferenceEquals(other, null))
                     return false;
+
                 return other.Kind == NotificationKind.OnCompleted;
             }
 
@@ -449,7 +452,7 @@ namespace System.Reactive
         /// Determines whether the current <see cref="Notification{T}"/> object has the same observer message payload as a specified <see cref="Notification{T}"/> value.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="Notification{T}"/> object.</param>
-        /// <returns>true if both <see cref="Notification{T}"/> objects have the same observer message payload; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="Notification{T}"/> objects have the same observer message payload; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
@@ -460,9 +463,9 @@ namespace System.Reactive
         /// <summary>
         /// Determines whether the two specified <see cref="Notification{T}"/> objects have the same observer message payload.
         /// </summary>
-        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <returns>true if the first <see cref="Notification{T}"/> value has the same observer message payload as the second <see cref="Notification{T}"/> value; otherwise, false.</returns>
+        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <returns><c>true</c> if the first <see cref="Notification{T}"/> value has the same observer message payload as the second <see cref="Notification{T}"/> value; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
@@ -470,7 +473,7 @@ namespace System.Reactive
         /// </remarks>
         public static bool operator ==(Notification<T> left, Notification<T> right)
         {
-            if (object.ReferenceEquals(left, right))
+            if (ReferenceEquals(left, right))
                 return true;
 
             if ((object)left == null || (object)right == null)
@@ -482,9 +485,9 @@ namespace System.Reactive
         /// <summary>
         /// Determines whether the two specified <see cref="Notification{T}"/> objects have a different observer message payload.
         /// </summary>
-        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or null.</param>
-        /// <returns>true if the first <see cref="Notification{T}"/> value has a different observer message payload as the second <see cref="Notification{T}"/> value; otherwise, false.</returns>
+        /// <param name="left">The first <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <param name="right">The second <see cref="Notification{T}"/> to compare, or <c>null</c>.</param>
+        /// <returns><c>true</c> if the first <see cref="Notification{T}"/> value has a different observer message payload as the second <see cref="Notification{T}"/> value; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
@@ -496,7 +499,7 @@ namespace System.Reactive
         /// Determines whether the specified System.Object is equal to the current <see cref="Notification{T}"/>.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="Notification{T}"/>.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="Notification{T}"/>; otherwise, false.</returns>
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="Notification{T}"/>; otherwise, <c>false</c>.</returns>
         /// <remarks>
         /// Equality of <see cref="Notification{T}"/> objects is based on the equality of the observer message payload they represent, including the notification Kind and the Value or Exception (if any).
         /// This means two <see cref="Notification{T}"/> objects can be equal even though they don't represent the same observer method call, but have the same Kind and have equal parameters passed to the observer method.
@@ -554,9 +557,12 @@ namespace System.Reactive
 
             return new AnonymousObservable<T>(observer => scheduler.Schedule(() =>
             {
-                this.Accept(observer);
-                if (this.Kind == NotificationKind.OnNext)
+                Accept(observer);
+
+                if (Kind == NotificationKind.OnNext)
+                {
                     observer.OnCompleted();
+                }
             }));
         }
     }

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

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

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

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

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

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

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

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

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

@@ -39,32 +39,32 @@ namespace System.Reactive
         public TimeSpan Interval { get; }
 
         /// <summary>
-        /// Determines whether the current <see cref="TimeInterval{T}"/> value has the same Value and Interval as a specified <see cref="TimeInterval{T}"/> value.
+        /// Determines whether the current <see cref="TimeInterval{T}"/> value has the same <see cref="Value"/> and <see cref="Interval"/> as a specified <see cref="TimeInterval{T}"/> value.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="TimeInterval{T}"/> value.</param>
-        /// <returns>true if both <see cref="TimeInterval{T}"/> values have the same Value and Interval; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="TimeInterval{T}"/> values have the same <see cref="Value"/> and <see cref="Interval"/>; otherwise, <c>false</c>.</returns>
         public bool Equals(TimeInterval<T> other)
         {
             return other.Interval.Equals(Interval) && EqualityComparer<T>.Default.Equals(Value, other.Value);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values have the same Value and Interval.
+        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values have the same <see cref="Value"/> and <see cref="Interval"/>.
         /// </summary>
         /// <param name="first">The first <see cref="TimeInterval{T}"/> value to compare.</param>
         /// <param name="second">The second <see cref="TimeInterval{T}"/> value to compare.</param>
-        /// <returns>true if the first <see cref="TimeInterval{T}"/> value has the same Value and Interval as the second <see cref="TimeInterval{T}"/> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="TimeInterval{T}"/> value has the same <see cref="Value"/> and <see cref="Interval"/> as the second <see cref="TimeInterval{T}"/> value; otherwise, <c>false</c>.</returns>
         public static bool operator ==(TimeInterval<T> first, TimeInterval<T> second)
         {
             return first.Equals(second);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values don't have the same Value and Interval.
+        /// Determines whether the two specified <see cref="TimeInterval{T}"/> values don't have the same <see cref="Value"/> and <see cref="Interval"/>.
         /// </summary>
         /// <param name="first">The first <see cref="TimeInterval{T}"/> value to compare.</param>
         /// <param name="second">The second <see cref="TimeInterval{T}"/> value to compare.</param>
-        /// <returns>true if the first <see cref="TimeInterval{T}"/> value has a different Value or Interval as the second <see cref="TimeInterval{T}"/> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="TimeInterval{T}"/> value has a different <see cref="Value"/> or <see cref="Interval"/> as the second <see cref="TimeInterval{T}"/> value; otherwise, <c>false</c>.</returns>
         public static bool operator !=(TimeInterval<T> first, TimeInterval<T> second)
         {
             return !first.Equals(second);
@@ -74,7 +74,7 @@ namespace System.Reactive
         /// Determines whether the specified System.Object is equal to the current <see cref="TimeInterval{T}"/>.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="TimeInterval{T}"/>.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="TimeInterval{T}"/>; otherwise, false.</returns>
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="TimeInterval{T}"/>; otherwise, <c>false</c>.</returns>
         public override bool Equals(object obj)
         {
             if (!(obj is TimeInterval<T>))

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

@@ -40,32 +40,32 @@ namespace System.Reactive
         public DateTimeOffset Timestamp { get; }
 
         /// <summary>
-        /// Determines whether the current <see cref="Timestamped{T}" /> value has the same Value and Timestamp as a specified <see cref="Timestamped{T}" /> value.
+        /// Determines whether the current <see cref="Timestamped{T}" /> value has the same <see cref="Value"/> and <see cref="Timestamp"/> as a specified <see cref="Timestamped{T}" /> value.
         /// </summary>
         /// <param name="other">An object to compare to the current <see cref="Timestamped{T}" /> value.</param>
-        /// <returns>true if both <see cref="Timestamped{T}" /> values have the same Value and Timestamp; otherwise, false.</returns>
+        /// <returns><c>true</c> if both <see cref="Timestamped{T}" /> values have the same <see cref="Value"/> and <see cref="Timestamp"/>; otherwise, <c>false</c>.</returns>
         public bool Equals(Timestamped<T> other)
         {
             return other.Timestamp.Equals(Timestamp) && EqualityComparer<T>.Default.Equals(Value, other.Value);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="Timestamped{T}" /> values have the same Value and Timestamp.
+        /// Determines whether the two specified <see cref="Timestamped{T}" /> values have the same <see cref="Value"/> and <see cref="Timestamp"/>.
         /// </summary>
         /// <param name="first">The first <see cref="Timestamped{T}" /> value to compare.</param>
         /// <param name="second">The second <see cref="Timestamped{T}" /> value to compare.</param>
-        /// <returns>true if the first <see cref="Timestamped{T}" /> value has the same Value and Timestamp as the second <see cref="Timestamped{T}" /> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="Timestamped{T}" /> value has the same <see cref="Value"/> and <see cref="Timestamp"/> as the second <see cref="Timestamped{T}" /> value; otherwise, <c>false</c>.</returns>
         public static bool operator ==(Timestamped<T> first, Timestamped<T> second)
         {
             return first.Equals(second);
         }
 
         /// <summary>
-        /// Determines whether the two specified <see cref="Timestamped{T}" /> values don't have the same Value and Timestamp.
+        /// Determines whether the two specified <see cref="Timestamped{T}" /> values don't have the same <see cref="Value"/> and <see cref="Timestamp"/>.
         /// </summary>
         /// <param name="first">The first <see cref="Timestamped{T}" /> value to compare.</param>
         /// <param name="second">The second <see cref="Timestamped{T}" /> value to compare.</param>
-        /// <returns>true if the first <see cref="Timestamped{T}" /> value has a different Value or Timestamp as the second <see cref="Timestamped{T}" /> value; otherwise, false.</returns>
+        /// <returns><c>true</c> if the first <see cref="Timestamped{T}" /> value has a different <see cref="Value"/> or <see cref="Timestamp"/> as the second <see cref="Timestamped{T}" /> value; otherwise, <c>false</c>.</returns>
         public static bool operator !=(Timestamped<T> first, Timestamped<T> second)
         {
             return !first.Equals(second);
@@ -75,7 +75,7 @@ namespace System.Reactive
         /// Determines whether the specified System.Object is equal to the current <see cref="Timestamped{T}" />.
         /// </summary>
         /// <param name="obj">The System.Object to compare with the current <see cref="Timestamped{T}" />.</param>
-        /// <returns>true if the specified System.Object is equal to the current <see cref="Timestamped{T}" />; otherwise, false.</returns>
+        /// <returns><c>true</c> if the specified System.Object is equal to the current <see cref="Timestamped{T}" />; otherwise, <c>false</c>.</returns>
         public override bool Equals(object obj)
         {
             if (!(obj is Timestamped<T>))