Model: Move parameter string generation to ParameterInfo
This commit is contained in:
@@ -159,10 +159,7 @@ namespace Il2CppInspector.Reflection
|
||||
}
|
||||
|
||||
// Get C# syntax-friendly list of parameters
|
||||
public string GetParametersString() =>
|
||||
string.Join(", ", DeclaredParameters.Select(p => $"{p.CustomAttributes.ToString(inline: true).Replace("[ParamArray]", "params")}"
|
||||
+ $"{p.GetModifierString()}{p.ParameterType.CSharpName} {p.Name}"
|
||||
+ (p.HasDefaultValue? " = " + p.DefaultValue.ToCSharpValue() : "")));
|
||||
public string GetParametersString() => string.Join(", ", DeclaredParameters.Select(p => p.GetParameterString()));
|
||||
|
||||
public string GetTypeParametersString() => GenericTypeParameters == null? "" :
|
||||
"<" + string.Join(", ", GenericTypeParameters.Select(p => p.CSharpName)) + ">";
|
||||
|
||||
@@ -91,5 +91,13 @@ namespace Il2CppInspector.Reflection
|
||||
(IsIn ? "in " : "")
|
||||
+ (IsByRef? "ref " : "")
|
||||
+ (IsOut? "out " : "");
|
||||
|
||||
public string GetParameterString() => IsRetval? null :
|
||||
$"{CustomAttributes.ToString(inline: true).Replace("[ParamArray]", "params")}"
|
||||
+ $"{GetModifierString()}{ParameterType.CSharpName} {Name}"
|
||||
+ (HasDefaultValue ? " = " + DefaultValue.ToCSharpValue() : "");
|
||||
|
||||
public string GetReturnParameterString() => !IsRetval? null :
|
||||
$"{GetModifierString()}{ParameterType.CSharpName}";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user