Re-factoring / boilerplate code

This commit is contained in:
Katy Coe
2017-11-08 01:08:02 +01:00
parent 3db660a454
commit 5e652606b2
7 changed files with 75 additions and 39 deletions

View File

@@ -4,6 +4,7 @@
All rights reserved.
*/
using System;
using System.Reflection;
namespace Il2CppInspector.Reflection {
@@ -29,16 +30,16 @@ namespace Il2CppInspector.Reflection {
// https://docs.microsoft.com/en-us/dotnet/api/system.reflection.fieldinfo.isfamilyandassembly?view=netframework-4.7.1#System_Reflection_FieldInfo_IsFamilyAndAssembly
// True if the field is declared as internal
public bool IsAssembly { get; } // TODO
public bool IsAssembly => throw new NotImplementedException();
// True if the field is declared as protected
public bool IsFamily { get; } // TODO
public bool IsFamily => throw new NotImplementedException();
// True if the field is declared as 'protected private' (always false)
public bool IsFamilyAndAssembly => false;
// True if the field is declared as protected public
public bool IsFamilyOrAssembly { get; } // TODO
public bool IsFamilyOrAssembly => throw new NotImplementedException();
// True if the field is declared as readonly
public bool IsInitOnly => (Attributes & FieldAttributes.InitOnly) == FieldAttributes.InitOnly;
@@ -52,7 +53,7 @@ namespace Il2CppInspector.Reflection {
// True if the field is declared as static
public bool IsStatic => (Attributes & FieldAttributes.Static) == FieldAttributes.Static;
public override MemberTypes MemberType { get; }
public override MemberTypes MemberType => MemberTypes.Field;
public FieldInfo(Il2CppInspector pkg, int fieldIndex, TypeInfo declaringType) :
base(declaringType) {