Model: Add PropertyAttributes
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user