Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Apply suggestions from dotnet-api-docs review
  • Loading branch information
dakersnar committed Sep 20, 2022
commit 8cc97a9fa4cdfd49ed2c3964d3e0b8ccd52c5ca4
20 changes: 9 additions & 11 deletions src/libraries/System.Private.CoreLib/src/System/Enum.cs
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,10 @@ public static Array GetValues(Type enumType)
/// </summary>
/// <typeparam name="TEnum">An enumeration type.</typeparam>
/// /// <remarks>
/// This method can be used to get enumeration values when creating an array of the enumeration type is challenging.
/// For example, <see cref="T:System.Reflection.MetadataLoadContext" /> or on a platform where runtime codegen is not available.
/// You can use this method to get enumeration values when it's hard to create an array of the enumeration type.
/// For example, you might use this method for the <see cref="T:System.Reflection.MetadataLoadContext" /> enumeration or on a platform where run-time code generation is not available.
/// </remarks>
/// <returns>An array that contains the values of the underlying type constants in enumType.</returns>
/// <returns>An array that contains the values of the underlying type constants in <typeparamref name="TEnum" />.</returns>
public static Array GetValuesAsUnderlyingType<TEnum>() where TEnum : struct, Enum =>
typeof(TEnum).GetEnumValuesAsUnderlyingType();

Expand All @@ -339,16 +339,14 @@ public static Array GetValuesAsUnderlyingType<TEnum>() where TEnum : struct, Enu
/// </summary>
/// <param name="enumType">An enumeration type.</param>
/// <remarks>
/// This method can be used to get enumeration values when creating an array of the enumeration type is challenging.
/// For example, <see cref="T:System.Reflection.MetadataLoadContext" /> or on a platform where runtime codegen is not available.
/// You can use this method to get enumeration values when it's hard to create an array of the enumeration type.
/// For example, you might use this method for the <see cref="T:System.Reflection.MetadataLoadContext" /> enumeration or on a platform where run-time code generation is not available.
/// </remarks>
/// <returns>An array that contains the values of the underlying type constants in <paramref name="enumType" />.</returns>
/// <exception cref="ArgumentNullException">
/// Thrown when the enumeration type is null.
/// </exception>
/// <exception cref="ArgumentException">
/// Thrown when the type is not an enumeration type.
/// </exception>
/// <exception cref="T:System.ArgumentNullException">
/// <paramref name="enumType" /> is null.</exception>
/// <exception cref="T:System.ArgumentException">
/// <paramref name="enumType" /> is not an enumeration type.</exception>
public static Array GetValuesAsUnderlyingType(Type enumType)
{
ArgumentNullException.ThrowIfNull(enumType);
Expand Down
12 changes: 5 additions & 7 deletions src/libraries/System.Private.CoreLib/src/System/Type.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,14 @@ public virtual Array GetEnumValues()
}

/// <summary>
/// Retrieves an array of the values of the underlying type constants in a specified enumeration type.
/// Retrieves an array of the values of the underlying type constants of this enumeration type.
/// </summary>
/// <remarks>
/// This method can be used to get enumeration values when creating an array of the enumeration type is challenging.
/// For example, <see cref="T:System.Reflection.MetadataLoadContext" /> or on a platform where runtime codegen is not available.
/// You can use this method to get enumeration values when it's hard to create an array of the enumeration type.
/// For example, you might use this method for the <see cref="T:System.Reflection.MetadataLoadContext" /> enumeration or on a platform where run-time code generation is not available.
/// </remarks>
/// <returns>An array that contains the values of the underlying type constants in enumType.</returns>
/// <exception cref="ArgumentException">
/// Thrown when the type is not an enumeration type.
/// </exception>
/// <returns>An array that contains the values of the underlying type constants in this enumeration type.</returns>
/// <exception cref="T:System.ArgumentException">This type is not an enumeration type.</exception>
public virtual Array GetEnumValuesAsUnderlyingType() => throw new NotSupportedException(SR.NotSupported_SubclassOverride);

[RequiresDynamicCode("The code for an array of the specified type might not be available.")]
Expand Down