Skip to content

Commit

Permalink
Add ObjectDisposedException.ThrowIf XML comments (#72411)
Browse files Browse the repository at this point in the history
* Add ObjectDisposedException.ThrowIf XML comments

Co-authored-by: Carlos Sanchez <[email protected]>
  • Loading branch information
stephentoub and carlossanlop authored Jul 19, 2022
1 parent a674645 commit 0a591d0
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ protected ObjectDisposedException(SerializationInfo info, StreamingContext conte
_objectName = info.GetString("ObjectName");
}

/// <summary>Throws an <see cref="ObjectDisposedException"/> if the specified <paramref name="condition"/> is <see langword="true"/>.</summary>
/// <param name="condition">The condition to evaluate.</param>
/// <param name="instance">The object whose type's full name should be included in any resulting <see cref="ObjectDisposedException"/>.</param>
/// <exception cref="ObjectDisposedException">The <paramref name="condition"/> is <see langword="true"/>.</exception>
[StackTraceHidden]
public static void ThrowIf([DoesNotReturnIf(true)] bool condition, object instance)
{
Expand All @@ -55,6 +59,10 @@ public static void ThrowIf([DoesNotReturnIf(true)] bool condition, object instan
}
}

/// <summary>Throws an <see cref="ObjectDisposedException"/> if the specified <paramref name="condition"/> is <see langword="true"/>.</summary>
/// <param name="condition">The condition to evaluate.</param>
/// <param name="type">The type whose full name should be included in any resulting <see cref="ObjectDisposedException"/>.</param>
/// <exception cref="ObjectDisposedException">The <paramref name="condition"/> is <see langword="true"/>.</exception>
[StackTraceHidden]
public static void ThrowIf([DoesNotReturnIf(true)] bool condition, Type type)
{
Expand Down

0 comments on commit 0a591d0

Please sign in to comment.