From ea252fd8b5942c22faeaecbb69d00ebbe9039b51 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 18 Jul 2022 17:56:49 -0400 Subject: [PATCH 1/2] Add ObjectDisposedException.ThrowIf XML comments --- .../src/System/ObjectDisposedException.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs b/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs index 32888e648cc985..b33dbd074c0c97 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs @@ -46,6 +46,10 @@ protected ObjectDisposedException(SerializationInfo info, StreamingContext conte _objectName = info.GetString("ObjectName"); } + /// Throws an if the specified is . + /// The condition to evaluate. + /// The object whose type's full name should be included in any resulting . + /// The is true. [StackTraceHidden] public static void ThrowIf([DoesNotReturnIf(true)] bool condition, object instance) { @@ -55,6 +59,10 @@ public static void ThrowIf([DoesNotReturnIf(true)] bool condition, object instan } } + /// Throws an if the specified is . + /// The condition to evaluate. + /// The type whose full name should be included in any resulting . + /// The is true. [StackTraceHidden] public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type) { From 348c2ebdefc93a8e0cc8f16e17e075694c000c7e Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Mon, 18 Jul 2022 20:37:01 -0400 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Carlos Sanchez <1175054+carlossanlop@users.noreply.github.com> --- .../src/System/ObjectDisposedException.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs b/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs index b33dbd074c0c97..c0d5803d79f4e7 100644 --- a/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs +++ b/src/libraries/System.Private.CoreLib/src/System/ObjectDisposedException.cs @@ -49,7 +49,7 @@ protected ObjectDisposedException(SerializationInfo info, StreamingContext conte /// Throws an if the specified is . /// The condition to evaluate. /// The object whose type's full name should be included in any resulting . - /// The is true. + /// The is . [StackTraceHidden] public static void ThrowIf([DoesNotReturnIf(true)] bool condition, object instance) { @@ -62,7 +62,7 @@ public static void ThrowIf([DoesNotReturnIf(true)] bool condition, object instan /// Throws an if the specified is . /// The condition to evaluate. /// The type whose full name should be included in any resulting . - /// The is true. + /// The is . [StackTraceHidden] public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type) {