using dnlib.DotNet;
using Newtonsoft.Json;
using ReCodeIt.Enums;
namespace ReCodeIt.Models;
///
/// Object to store linq statements in inside of json to search and remap classes
///
public class RemapModel
{
[JsonIgnore]
public bool Succeeded { get; set; } = false;
[JsonIgnore]
public List NoMatchReasons { get; set; } = [];
///
/// This is a list of type candidates that made it through the filter
///
[JsonIgnore]
public HashSet TypeCandidates { get; set; } = [];
///
/// This is the final chosen type we will use to remap
///
[JsonIgnore]
public TypeDef TypePrimeCandidate { get; set; }
public string NewTypeName { get; set; } = string.Empty;
public string OriginalTypeName { get; set; } = string.Empty;
public bool UseForceRename { get; set; }
public SearchParams SearchParams { get; set; } = new();
}
///
/// Search filters to find types and remap them
///
public class SearchParams
{
#region BOOL_PARAMS
///
/// Default to true, most types are public
///
public bool IsPublic { get; set; } = true;
public bool? IsAbstract { get; set; } = null;
public bool? IsInterface { get; set; } = null;
public bool? IsStruct { get; set; } = null;
public bool? IsEnum { get; set; } = null;
public bool? IsNested { get; set; } = null;
public bool? IsSealed { get; set; } = null;
public bool? HasAttribute { get; set; } = null;
public bool? IsDerived { get; set; } = null;
public bool? HasGenericParameters { get; set; } = null;
#endregion BOOL_PARAMS
#region STR_PARAMS
///
/// Name of the nested types parent
///
public string? NTParentName { get; set; } = null;
///
/// Name of the derived classes declaring type
///
public string? MatchBaseClass { get; set; } = null;
///
/// Name of the derived classes declaring type we want to ignore
///
public string? IgnoreBaseClass { get; set; } = null;
#endregion STR_PARAMS
#region INT_PARAMS
public int? ConstructorParameterCount { get; set; } = null;
public int? MethodCount { get; set; } = null;
public int? FieldCount { get; set; } = null;
public int? PropertyCount { get; set; } = null;
public int? NestedTypeCount { get; set; } = null;
#endregion INT_PARAMS
#region LISTS
public List IncludeMethods { get; set; }
public List ExcludeMethods { get; set; }
public List IncludeFields { get; set; }
public List ExcludeFields { get; set; }
public List IncludeProperties { get; set; }
public List ExcludeProperties { get; set; }
public List IncludeNestedTypes { get; set; }
public List ExcludeNestedTypes { get; set; }
#endregion LISTS
public SearchParams()
{
}
}
internal class AdvancedSearchParams
{
}