using dnlib.DotNet;
namespace ReCodeIt.AutoMapper;
///
/// Represents a match of a field name to obfuscated class
///
///
///
///
///
public sealed class MappingPair(
TypeDef type,
string name,
bool isInterface,
bool isStruct,
bool isPublic)
{
public TypeDef OriginalTypeDefinition { get; private set; } = type;
///
/// The type reference we want to change
///
public TypeDef NewTypeRef { get; set; }
///
/// Is this field an interface?
///
public bool IsInterface { get; set; } = isInterface;
///
/// Is this type a struct?
///
public bool IsStruct { get; set; } = isStruct;
///
/// Has this type been renamed? Use for checking for failures at the end
///
public bool HasBeenRenamed { get; set; } = false;
///
/// Did this match come from a method?
///
public AutoMappingResult AutoMappingResult { get; set; } = AutoMappingResult.None;
///
/// This is the name we want to change the assembly class to
///
public string Name { get; set; } = name;
///
/// Original name of the property or field type
///
public string OriginalPropOrFieldName { get; } = name;
}
public enum AutoMappingResult
{
None,
Match_From_Field,
Match_From_Property,
Match_From_Method,
Fail_From_Already_Contained_Name,
Fail_From_New_Type_Ref_Null,
}