Browse Source

Rename and add documentation

pull/3470/head
ds5678 2 months ago committed by Jeremy Pritts
parent
commit
5b8446c619
  1. 2
      ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs
  2. 12
      ICSharpCode.Decompiler/TypeSystem/IParameter.cs
  3. 2
      ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs

2
ICSharpCode.Decompiler/CSharp/Syntax/TypeSystemAstBuilder.cs

@ -1735,7 +1735,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax @@ -1735,7 +1735,7 @@ namespace ICSharpCode.Decompiler.CSharp.Syntax
{
decl.Name = parameter.Name;
}
if (parameter.GetDefaultValueAssignmentAllowed() && this.ShowConstantValues)
if (parameter.IsDefaultValueAssignmentAllowed() && this.ShowConstantValues)
{
try
{

12
ICSharpCode.Decompiler/TypeSystem/IParameter.cs

@ -108,7 +108,17 @@ namespace ICSharpCode.Decompiler.TypeSystem @@ -108,7 +108,17 @@ namespace ICSharpCode.Decompiler.TypeSystem
internal static class IParameterExtensions
{
public static bool GetDefaultValueAssignmentAllowed(this IParameter parameter)
/// <summary>
/// Checks if the parameter is allowed to be assigned a default value.
/// </summary>
/// <remarks>
/// This checks <see cref="IParameter.IsOptional"/>, <see cref="IParameter.HasConstantValueInSignature"/>, <see cref="IParameter.ReferenceKind"/>,
/// and <see cref="IParameter.IsParams"/> on this parameter and all subsequent parameters.
/// If the parameter has no <see cref="IParameter.Owner"/>, it does not check subsequent parameters.
/// </remarks>
/// <param name="parameter">The parameter</param>
/// <returns>True if the <paramref name="parameter"/> has a default value and is allowed to be assigned a default value.</returns>
public static bool IsDefaultValueAssignmentAllowed(this IParameter parameter)
{
if (!DefaultValueAssignmentAllowedIndividual(parameter))
return false;

2
ICSharpCode.Decompiler/TypeSystem/Implementation/MetadataParameter.cs

@ -63,7 +63,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation @@ -63,7 +63,7 @@ namespace ICSharpCode.Decompiler.TypeSystem.Implementation
var metadata = module.metadata;
var parameter = metadata.GetParameter(handle);
bool defaultValueAssignmentAllowed = this.GetDefaultValueAssignmentAllowed();
bool defaultValueAssignmentAllowed = this.IsDefaultValueAssignmentAllowed();
if (IsOptional && !defaultValueAssignmentAllowed)
{

Loading…
Cancel
Save