Model: Additional tweaks to type name properties

This commit is contained in:
Katy Coe
2019-11-02 18:33:02 +01:00
parent a62b8bf800
commit b4e589f704

View File

@@ -102,12 +102,11 @@ namespace Il2CppInspector.Reflection {
public string FullName => public string FullName =>
IsGenericParameter? null : IsGenericParameter? null :
(IsPointer? "void *" : "") (IsPointer? "void *" : "")
+ Namespace + (DeclaringType != null? DeclaringType.FullName + "+" :
+ (Namespace.Length > 0? "." : "") Namespace + (Namespace.Length > 0? "." : ""))
+ (DeclaringType != null? DeclaringType.Name + "+" : "")
+ base.Name + base.Name
+ (GenericTypeParameters != null ? "[" + string.Join(",", GenericTypeParameters.Select(x => x.Name)) + "]" : "") + (GenericTypeParameters != null ? "[" + string.Join(",", GenericTypeParameters.Select(x => x.FullName ?? x.Name)) + "]" : "")
+ (GenericTypeArguments != null ? "[" + string.Join(",", GenericTypeArguments.Select(x => x.Name)) + "]" : "") + (GenericTypeArguments != null ? "[" + string.Join(",", GenericTypeArguments.Select(x => x.FullName ?? x.Name)) + "]" : "")
+ (IsArray? "[]" : ""); + (IsArray? "[]" : "");
// TODO: Alot of other generics stuff // TODO: Alot of other generics stuff
@@ -413,6 +412,12 @@ namespace Il2CppInspector.Reflection {
} }
// Display name of object // Display name of object
public override string ToString() => FullName?.Substring(FullName.LastIndexOf(".") + 1) ?? Name; public override string ToString() => IsGenericParameter ? Name :
(IsPointer ? "void *" : "")
+ (DeclaringType != null ? DeclaringType.Name + "+" : "")
+ base.Name
+ (GenericTypeParameters != null ? "[" + string.Join(",", GenericTypeParameters.Select(x => x.Namespace != Namespace? x.FullName ?? x.Name : x.ToString())) + "]" : "")
+ (GenericTypeArguments != null ? "[" + string.Join(",", GenericTypeArguments.Select(x => x.Namespace != Namespace? x.FullName ?? x.Name : x.ToString())) + "]" : "")
+ (IsArray ? "[]" : "");
} }
} }