From e9a66b98d4025faa7a65c6951f0336864af14a38 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Thu, 7 Jan 2021 23:10:57 +0100 Subject: [PATCH] Model: Add PropertyAttributes --- Il2CppInspector.Common/Reflection/PropertyInfo.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Il2CppInspector.Common/Reflection/PropertyInfo.cs b/Il2CppInspector.Common/Reflection/PropertyInfo.cs index bf8712e..2c12f58 100644 --- a/Il2CppInspector.Common/Reflection/PropertyInfo.cs +++ b/Il2CppInspector.Common/Reflection/PropertyInfo.cs @@ -18,6 +18,9 @@ namespace Il2CppInspector.Reflection { // Root definition: the property with Definition != null protected readonly PropertyInfo rootDefinition; + // Information/flags about the property + public PropertyAttributes Attributes { get; } + public bool CanRead => GetMethod != null; public bool CanWrite => SetMethod != null; @@ -52,6 +55,9 @@ namespace Il2CppInspector.Reflection { Name = pkg.Strings[Definition.nameIndex]; rootDefinition = this; + // Copy attributes + Attributes = (PropertyAttributes) Definition.attrs; + // prop.get and prop.set are method indices from the first method of the declaring type if (Definition.get >= 0) GetMethod = declaringType.DeclaredMethods.First(x => x.Index == declaringType.Definition.methodStart + Definition.get);