Files
Il2CppInspectorRedux/Il2CppInspector/Reflection/MemberInfo.cs
Katy Coe 521f82ed4d Implement MemberInfo, FieldInfo, TypeInfo.DeclaredFields
Rename Type to TypeInfo
Add TypeInfo.CSharpName
Implement some generic types/parameters
Implement arrays
Remove obsolete Il2CppType.GetTypeFromTypeIndex
Implement enhanced Il2CppReflector.GetTypeFromTypeIndex (can create array and generic types on-the-fly from Il2CppType usages)
2017-11-07 05:31:52 +01:00

38 lines
1.3 KiB
C#

using System.Collections.Generic;
using System.Reflection;
namespace Il2CppInspector.Reflection {
public abstract class MemberInfo
{
// Assembly that this member is defined in. Only set when MemberType == TypeInfo
public Assembly Assembly { get; }
// Custom attributes for this member
public IEnumerable<CustomAttributeData> CustomAttributes { get; } // TODO
// Type that this type is declared in for nested types
public TypeInfo DeclaringType { get; }
// What sort of member this is, eg. method, field etc.
public abstract MemberTypes MemberType { get; }
// Name of the member
public virtual string Name { get; protected set; }
// TODO: GetCustomAttributes etc.
// For top-level members in an assembly (ie. non-nested types)
protected MemberInfo(Assembly asm, TypeInfo declaringType = null) {
Assembly = asm;
DeclaringType = declaringType;
}
// For lower level members, eg. fields, properties etc. and nested types
protected MemberInfo(TypeInfo declaringType) {
if (declaringType != null) {
Assembly = declaringType.Assembly;
DeclaringType = declaringType;
}
}
}
}