Added a strongly-typed property for the type to ResolvedParameter and ResolvedMethod
This commit is contained in:
parent
9945e82cb7
commit
b5b3a19b66
@ -183,15 +183,18 @@ namespace System.Diagnostics
|
|||||||
Prefix = "",
|
Prefix = "",
|
||||||
Name = "",
|
Name = "",
|
||||||
Type = TypeNameHelper.GetTypeDisplayName(mi.ReturnType, fullName: false, includeGenericParameterNames: true).ToString(),
|
Type = TypeNameHelper.GetTypeDisplayName(mi.ReturnType, fullName: false, includeGenericParameterNames: true).ToString(),
|
||||||
|
ResolvedType = mi.ReturnType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (method.IsGenericMethod)
|
if (method.IsGenericMethod)
|
||||||
{
|
{
|
||||||
var genericArguments = string.Join(", ", method.GetGenericArguments()
|
var genericArguments = method.GetGenericArguments();
|
||||||
|
var genericArgumentsString = string.Join(", ", genericArguments
|
||||||
.Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true)));
|
.Select(arg => TypeNameHelper.GetTypeDisplayName(arg, fullName: false, includeGenericParameterNames: true)));
|
||||||
methodDisplayInfo.GenericArguments += "<" + genericArguments + ">";
|
methodDisplayInfo.GenericArguments += "<" + genericArgumentsString + ">";
|
||||||
|
methodDisplayInfo.ResolvedGenericArguments = genericArguments;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method parameters
|
// Method parameters
|
||||||
@ -535,6 +538,7 @@ namespace System.Diagnostics
|
|||||||
Prefix = prefix,
|
Prefix = prefix,
|
||||||
Name = parameter.Name,
|
Name = parameter.Name,
|
||||||
Type = parameterTypeString,
|
Type = parameterTypeString,
|
||||||
|
ResolvedType = parameterType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -566,6 +570,7 @@ namespace System.Diagnostics
|
|||||||
Prefix = prefix,
|
Prefix = prefix,
|
||||||
Name = parameter.Name,
|
Name = parameter.Name,
|
||||||
Type = parameterTypeString,
|
Type = parameterTypeString,
|
||||||
|
ResolvedType = parameterType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -605,6 +610,7 @@ namespace System.Diagnostics
|
|||||||
Prefix = prefix,
|
Prefix = prefix,
|
||||||
Name = name,
|
Name = name,
|
||||||
Type = sb.ToString(),
|
Type = sb.ToString(),
|
||||||
|
ResolvedType = parameterType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) .NET Foundation. All rights reserved.
|
// Copyright (c) .NET Foundation. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Collections.Generic.Enumerable;
|
using System.Collections.Generic.Enumerable;
|
||||||
@ -25,6 +25,8 @@ namespace System.Diagnostics
|
|||||||
|
|
||||||
public string GenericArguments { get; set; }
|
public string GenericArguments { get; set; }
|
||||||
|
|
||||||
|
public Type[] ResolvedGenericArguments { get; set; }
|
||||||
|
|
||||||
public MethodBase SubMethodBase { get; set; }
|
public MethodBase SubMethodBase { get; set; }
|
||||||
|
|
||||||
public string SubMethod { get; set; }
|
public string SubMethod { get; set; }
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) Ben A Adams. All rights reserved.
|
// Copyright (c) Ben A Adams. All rights reserved.
|
||||||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
|
||||||
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@ -11,6 +11,8 @@ namespace System.Diagnostics
|
|||||||
|
|
||||||
public string Type { get; set; }
|
public string Type { get; set; }
|
||||||
|
|
||||||
|
public Type ResolvedType { get; set; }
|
||||||
|
|
||||||
public string Prefix { get; set; }
|
public string Prefix { get; set; }
|
||||||
|
|
||||||
public override string ToString() => Append(new StringBuilder()).ToString();
|
public override string ToString() => Append(new StringBuilder()).ToString();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user