Self saving settings, refactor, and bug fixes
This commit is contained in:
parent
d87a6d4599
commit
940381f423
4
RecodeItGUI/GUI/Main.Designer.cs
generated
4
RecodeItGUI/GUI/Main.Designer.cs
generated
@ -302,6 +302,7 @@ partial class ReCodeItForm
|
||||
RemapperUnseal.TabIndex = 36;
|
||||
RemapperUnseal.Text = "Unseal";
|
||||
RemapperUnseal.UseVisualStyleBackColor = true;
|
||||
RemapperUnseal.CheckedChanged += RemapperUnseal_CheckedChanged;
|
||||
//
|
||||
// RemapperPublicicize
|
||||
//
|
||||
@ -314,6 +315,7 @@ partial class ReCodeItForm
|
||||
RemapperPublicicize.TabIndex = 35;
|
||||
RemapperPublicicize.Text = "Publicize";
|
||||
RemapperPublicicize.UseVisualStyleBackColor = true;
|
||||
RemapperPublicicize.CheckedChanged += RemapperPublicicize_CheckedChanged;
|
||||
//
|
||||
// RemapperOutputDirectoryPath
|
||||
//
|
||||
@ -346,6 +348,7 @@ partial class ReCodeItForm
|
||||
RenamePropertiesCheckbox.TabIndex = 28;
|
||||
RenamePropertiesCheckbox.Text = "Rename Properties";
|
||||
RenamePropertiesCheckbox.UseVisualStyleBackColor = true;
|
||||
RenamePropertiesCheckbox.CheckedChanged += RenamePropertiesCheckbox_CheckedChanged;
|
||||
//
|
||||
// OutputDirectoryButton
|
||||
//
|
||||
@ -386,6 +389,7 @@ partial class ReCodeItForm
|
||||
RenameFieldsCheckbox.TabIndex = 26;
|
||||
RenameFieldsCheckbox.Text = "Rename Fields";
|
||||
RenameFieldsCheckbox.UseVisualStyleBackColor = true;
|
||||
RenameFieldsCheckbox.CheckedChanged += RenameFieldsCheckbox_CheckedChanged;
|
||||
//
|
||||
// ConstructorCountEnabled
|
||||
//
|
||||
|
@ -84,8 +84,6 @@ public partial class ReCodeItForm : Form
|
||||
}
|
||||
|
||||
ReloadRemapTreeView(remaps!);
|
||||
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
#region BUTTONS
|
||||
@ -214,7 +212,6 @@ public partial class ReCodeItForm : Form
|
||||
else
|
||||
{
|
||||
DataProvider.Remaps?.RemoveAt(RemapTreeView.SelectedNode.Index);
|
||||
DataProvider.SaveMapping();
|
||||
}
|
||||
|
||||
RemapTreeView.SelectedNode?.Remove();
|
||||
@ -265,15 +262,7 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
private void SaveMappingFileButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (MessageBox.Show(
|
||||
"Are you sure?",
|
||||
"Confirmation",
|
||||
MessageBoxButtons.YesNo,
|
||||
MessageBoxIcon.Exclamation,
|
||||
MessageBoxDefaultButton.Button2) == DialogResult.Yes)
|
||||
{
|
||||
DataProvider.SaveMapping();
|
||||
}
|
||||
DataProvider.SaveMapping();
|
||||
}
|
||||
|
||||
private void LoadMappingFileButton_Click(object sender, EventArgs e)
|
||||
@ -287,7 +276,6 @@ public partial class ReCodeItForm : Form
|
||||
AppSettings.Remapper.MappingPath = result;
|
||||
AppSettings.Remapper.UseProjectMappings = false;
|
||||
ActiveProjectMappingsCheckbox.Checked = false;
|
||||
DataProvider.SaveAppSettings();
|
||||
|
||||
LoadedMappingFilePath.Text = result;
|
||||
|
||||
@ -466,6 +454,7 @@ public partial class ReCodeItForm : Form
|
||||
DataProvider.Settings.AutoMapper.TypesToIgnore.Add(AutoMapperTypesToIgnoreTextField.Text);
|
||||
AutoMapperTypesExcludeBox.Items.Add(AutoMapperTypesToIgnoreTextField.Text);
|
||||
AutoMapperTypesToIgnoreTextField.Clear();
|
||||
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
@ -476,6 +465,7 @@ public partial class ReCodeItForm : Form
|
||||
{
|
||||
DataProvider.Settings.AutoMapper.TypesToIgnore.RemoveAt(AutoMapperTypesExcludeBox.SelectedIndex);
|
||||
AutoMapperTypesExcludeBox.Items.Remove(AutoMapperTypesExcludeBox.SelectedItem);
|
||||
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
@ -493,6 +483,30 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
#endregion LISTBOX_BUTTONS
|
||||
|
||||
#region CHECKBOX
|
||||
|
||||
private void RemapperUnseal_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.Remapper.MappingSettings.Unseal = RemapperUnseal.Checked;
|
||||
}
|
||||
|
||||
private void RemapperPublicicize_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.Remapper.MappingSettings.Publicize = RemapperPublicicize.Checked;
|
||||
}
|
||||
|
||||
private void RenameFieldsCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.Remapper.MappingSettings.RenameFields = RenameFieldsCheckbox.Checked;
|
||||
}
|
||||
|
||||
private void RenamePropertiesCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.Remapper.MappingSettings.RenameProperties = RenamePropertiesCheckbox.Checked;
|
||||
}
|
||||
|
||||
#endregion CHECKBOX
|
||||
|
||||
#endregion BUTTONS
|
||||
|
||||
#endregion MANUAL_REMAPPER
|
||||
@ -520,37 +534,11 @@ public partial class ReCodeItForm : Form
|
||||
private void DebugLoggingCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.AppSettings.Debug = DebugLoggingCheckbox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void SilentModeCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.AppSettings.SilentMode = SilentModeCheckbox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void RenameFieldsCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.AppSettings.RenameFields = RenameFieldsCheckbox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void RenamePropertiesCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.AppSettings.RenameProperties = RenamePropertiesCheckbox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void PublicizeCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.Remapper.MappingSettings.Publicize = PublicizeCheckbox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void UnsealCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.Remapper.MappingSettings.Unseal = UnsealCheckbox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
#endregion CHECKBOXES
|
||||
@ -560,7 +548,6 @@ public partial class ReCodeItForm : Form
|
||||
private void AutoMapperRequiredMatchesUpDown_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
DataProvider.Settings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
#endregion UPDOWNS
|
||||
@ -615,7 +602,6 @@ public partial class ReCodeItForm : Form
|
||||
{
|
||||
AppSettings.AutoMapper.AssemblyPath = result;
|
||||
TargetAssemblyPath.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -627,20 +613,17 @@ public partial class ReCodeItForm : Form
|
||||
{
|
||||
AppSettings.AutoMapper.OutputPath = result;
|
||||
RemapperOutputDirectoryPath.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
private void AutoMapperRequiredMatchesUpDown_ValueChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void AutoMapperMinLengthUpDown_ValueChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.MinLengthToMatch = (int)AutoMapperMinLengthUpDown.Value;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void AutoMapperTokensAddButton_Click(object sender, EventArgs e)
|
||||
@ -650,8 +633,8 @@ public partial class ReCodeItForm : Form
|
||||
AutoMapperTokensBox.Items.Add(AutoMapperTokensTextField.Text);
|
||||
AppSettings.AutoMapper.TokensToMatch.Add(AutoMapperTokensTextField.Text);
|
||||
|
||||
AutoMapperTokensTextField.Clear();
|
||||
DataProvider.SaveAppSettings();
|
||||
AutoMapperTokensTextField.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -659,8 +642,8 @@ public partial class ReCodeItForm : Form
|
||||
{
|
||||
if (AutoMapperTokensBox.SelectedItem != null)
|
||||
{
|
||||
AppSettings.AutoMapper.TokensToMatch.RemoveAt(AutoMapperTokensBox.SelectedIndex);
|
||||
AutoMapperTokensBox.Items.Remove(AutoMapperTokensBox.SelectedItem);
|
||||
AppSettings.AutoMapper.TokensToMatch.RemoveAt(AutoMapperTokensBox.SelectedIndex + 1);
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
@ -672,8 +655,8 @@ public partial class ReCodeItForm : Form
|
||||
AutoMapperFPBox.Items.Add(AutoMapperFPTextField.Text);
|
||||
AppSettings.AutoMapper.PropertyFieldBlackList.Add(AutoMapperFPTextField.Text);
|
||||
|
||||
AutoMapperFPTextField.Clear();
|
||||
DataProvider.SaveAppSettings();
|
||||
AutoMapperFPTextField.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -681,8 +664,9 @@ public partial class ReCodeItForm : Form
|
||||
{
|
||||
if (AutoMapperFPBox.SelectedItem != null)
|
||||
{
|
||||
AutoMapperFPBox.Items.Remove(AutoMapperFPBox.SelectedItem);
|
||||
AppSettings.AutoMapper.PropertyFieldBlackList.RemoveAt(AutoMapperFPBox.SelectedIndex);
|
||||
AutoMapperFPBox.Items.Remove(AutoMapperFPBox.SelectedItem);
|
||||
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
@ -692,10 +676,11 @@ public partial class ReCodeItForm : Form
|
||||
if (!AutoMapperMethodBox.Items.Contains(AutoMapperMethodTextBox.Text))
|
||||
{
|
||||
AutoMapperMethodBox.Items.Add(AutoMapperMethodTextBox.Text);
|
||||
|
||||
AppSettings.AutoMapper.MethodParamaterBlackList.Add(AutoMapperMethodTextBox.Text);
|
||||
|
||||
AutoMapperMethodTextBox.Clear();
|
||||
DataProvider.SaveAppSettings();
|
||||
AutoMapperMethodTextBox.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -703,8 +688,12 @@ public partial class ReCodeItForm : Form
|
||||
{
|
||||
if (AutoMapperMethodBox.SelectedItem != null)
|
||||
{
|
||||
AutoMapperMethodBox.Items.Remove(AutoMapperMethodBox.SelectedItem);
|
||||
AppSettings.AutoMapper.MethodParamaterBlackList.RemoveAt(AutoMapperMethodBox.SelectedIndex > 0 ? AutoMapperMethodBox.SelectedIndex : 0);
|
||||
AppSettings.AutoMapper.MethodParamaterBlackList
|
||||
.RemoveAt(AutoMapperMethodBox.SelectedIndex);
|
||||
|
||||
AutoMapperMethodBox.Items
|
||||
.Remove(AutoMapperMethodBox.SelectedItem);
|
||||
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
@ -712,31 +701,26 @@ public partial class ReCodeItForm : Form
|
||||
private void SearchMethodsCheckBox_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.SearchMethods = AutoMapperSearchMethodsCheckBox.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void AutoMapperRenameFields_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.MappingSettings.RenameFields = AutoMapperRenameFields.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void AutoMapperRenameProps_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.MappingSettings.RenameProperties = AutoMapperRenameProps.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void AutoMapperPublicize_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.MappingSettings.Publicize = AutoMapperPublicize.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
private void AutoMapperUnseal_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.AutoMapper.MappingSettings.Unseal = AutoMapperUnseal.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
#endregion AUTOMAPPER
|
||||
@ -760,7 +744,6 @@ public partial class ReCodeItForm : Form
|
||||
if (!File.Exists(ccSettings.LastLoadedProject))
|
||||
{
|
||||
ccSettings.LastLoadedProject = string.Empty;
|
||||
DataProvider.SaveAppSettings();
|
||||
MessageBox.Show("Couldnt find last loaded project");
|
||||
return;
|
||||
}
|
||||
@ -791,7 +774,6 @@ public partial class ReCodeItForm : Form
|
||||
if (result != string.Empty)
|
||||
{
|
||||
CCOriginalAssemblyText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -802,7 +784,6 @@ public partial class ReCodeItForm : Form
|
||||
if (result != string.Empty)
|
||||
{
|
||||
CCRemappedOutputText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -814,7 +795,6 @@ public partial class ReCodeItForm : Form
|
||||
if (result != string.Empty)
|
||||
{
|
||||
CCVisualStudioProjDirText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -825,7 +805,6 @@ public partial class ReCodeItForm : Form
|
||||
if (result != string.Empty)
|
||||
{
|
||||
CCBuildDirText.Text = result;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
@ -885,7 +864,6 @@ public partial class ReCodeItForm : Form
|
||||
private void CCAutoLoadLastProj_CheckedChanged_1(object sender, EventArgs e)
|
||||
{
|
||||
AppSettings.CrossCompiler.AutoLoadLastActiveProject = CCAutoLoadLastProj.Checked;
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
|
||||
// Use the projects remap list on the remap tab
|
||||
@ -1002,7 +980,6 @@ public partial class ReCodeItForm : Form
|
||||
|
||||
DataProvider.Settings.Remapper.UseProjectMappings = true;
|
||||
ActiveProjectMappingsCheckbox.Checked = true;
|
||||
DataProvider.SaveAppSettings();
|
||||
|
||||
EditSelectedRemap(this, e, true);
|
||||
}
|
||||
|
@ -1,14 +1,64 @@
|
||||
namespace ReCodeIt.Models;
|
||||
using ReCodeIt.Utils;
|
||||
|
||||
namespace ReCodeIt.Models;
|
||||
|
||||
/// <summary>
|
||||
/// All settings container
|
||||
/// </summary>
|
||||
public class Settings
|
||||
{
|
||||
public AppSettings AppSettings { get; set; }
|
||||
public RemapperSettings Remapper { get; set; }
|
||||
public AutoMapperSettings AutoMapper { get; set; }
|
||||
public CrossCompilerSettings CrossCompiler { get; set; }
|
||||
private AppSettings _appSettings;
|
||||
|
||||
public AppSettings AppSettings
|
||||
{
|
||||
get { return _appSettings; }
|
||||
set
|
||||
{
|
||||
_appSettings = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private RemapperSettings _remapper;
|
||||
|
||||
public RemapperSettings Remapper
|
||||
{
|
||||
get { return _remapper; }
|
||||
set
|
||||
{
|
||||
_remapper = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private AutoMapperSettings _autoMapper;
|
||||
|
||||
public AutoMapperSettings AutoMapper
|
||||
{
|
||||
get { return _autoMapper; }
|
||||
set
|
||||
{
|
||||
_autoMapper = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private CrossCompilerSettings _crossCompiler;
|
||||
|
||||
public CrossCompilerSettings CrossCompiler
|
||||
{
|
||||
get { return _crossCompiler; }
|
||||
set
|
||||
{
|
||||
_crossCompiler = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -16,10 +66,34 @@ public class Settings
|
||||
/// </summary>
|
||||
public class AppSettings
|
||||
{
|
||||
public bool Debug { get; set; }
|
||||
public bool SilentMode { get; set; }
|
||||
public bool RenameFields { get; set; }
|
||||
public bool RenameProperties { get; set; }
|
||||
private bool _debug;
|
||||
|
||||
public bool Debug
|
||||
{
|
||||
get { return _debug; }
|
||||
set
|
||||
{
|
||||
_debug = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _silentMode;
|
||||
|
||||
public bool SilentMode
|
||||
{
|
||||
get { return _silentMode; }
|
||||
set
|
||||
{
|
||||
_silentMode = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -27,27 +101,82 @@ public class AppSettings
|
||||
/// </summary>
|
||||
public class RemapperSettings
|
||||
{
|
||||
private string _assemblyPath;
|
||||
|
||||
/// <summary>
|
||||
/// Path to the assembly we want to remap
|
||||
/// </summary>
|
||||
public string AssemblyPath { get; set; }
|
||||
public string AssemblyPath
|
||||
{
|
||||
get { return _assemblyPath; }
|
||||
set
|
||||
{
|
||||
_assemblyPath = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private string _outputPath;
|
||||
|
||||
/// <summary>
|
||||
/// Path including the filename and extension we want to write the changes to
|
||||
/// </summary>
|
||||
public string OutputPath { get; set; }
|
||||
public string OutputPath
|
||||
{
|
||||
get { return _outputPath; }
|
||||
set
|
||||
{
|
||||
_outputPath = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private string _mappingPath;
|
||||
|
||||
/// <summary>
|
||||
/// Path to the mapping file
|
||||
/// </summary>
|
||||
public string MappingPath { get; set; }
|
||||
public string MappingPath
|
||||
{
|
||||
get { return _mappingPath; }
|
||||
set
|
||||
{
|
||||
_mappingPath = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _useProjectMappings;
|
||||
|
||||
/// <summary>
|
||||
/// Use the projects mappings instead of a standalone file
|
||||
/// </summary>
|
||||
public bool UseProjectMappings { get; set; }
|
||||
public bool UseProjectMappings
|
||||
{
|
||||
get { return _useProjectMappings; }
|
||||
set
|
||||
{
|
||||
_useProjectMappings = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
public MappingSettings MappingSettings { get; set; }
|
||||
private MappingSettings _mappingSettings;
|
||||
|
||||
public MappingSettings MappingSettings
|
||||
{
|
||||
get { return _mappingSettings; }
|
||||
set
|
||||
{
|
||||
_mappingSettings = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -55,53 +184,158 @@ public class RemapperSettings
|
||||
/// </summary>
|
||||
public class AutoMapperSettings
|
||||
{
|
||||
private string _assemblyPath;
|
||||
|
||||
/// <summary>
|
||||
/// Path to the assembly we want to remap
|
||||
/// </summary>
|
||||
public string AssemblyPath { get; set; }
|
||||
public string AssemblyPath
|
||||
{
|
||||
get { return _assemblyPath; }
|
||||
set
|
||||
{
|
||||
_assemblyPath = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private string _outputPath;
|
||||
|
||||
/// <summary>
|
||||
/// Path including the filename and extension we want to write the changes to
|
||||
/// </summary>
|
||||
public string OutputPath { get; set; }
|
||||
public string OutputPath
|
||||
{
|
||||
get { return _outputPath; }
|
||||
set
|
||||
{
|
||||
_outputPath = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private int _requiredMatches;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum number of times a member must have this name in the assembly before considering it
|
||||
/// for remapping
|
||||
/// </summary>
|
||||
public int RequiredMatches { get; set; }
|
||||
public int RequiredMatches
|
||||
{
|
||||
get { return _requiredMatches; }
|
||||
set
|
||||
{
|
||||
_requiredMatches = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private int _minLengthToMatch;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum length of the field/property name in code before it will be considered for a rename
|
||||
/// </summary>
|
||||
public int MinLengthToMatch { get; set; }
|
||||
public int MinLengthToMatch
|
||||
{
|
||||
get { return _minLengthToMatch; }
|
||||
set
|
||||
{
|
||||
_minLengthToMatch = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _searchMethods;
|
||||
|
||||
/// <summary>
|
||||
/// Will attempt to map types from method meta data and parameters
|
||||
/// </summary>
|
||||
public bool SearchMethods { get; set; }
|
||||
public bool SearchMethods
|
||||
{
|
||||
get { return _searchMethods; }
|
||||
set
|
||||
{
|
||||
_searchMethods = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
public MappingSettings MappingSettings { get; set; }
|
||||
private MappingSettings _mappingSettings;
|
||||
|
||||
public MappingSettings MappingSettings
|
||||
{
|
||||
get { return _mappingSettings; }
|
||||
set
|
||||
{
|
||||
_mappingSettings = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> _typesToIgnore;
|
||||
|
||||
/// <summary>
|
||||
/// Any member name you want to ignore while iterating through the assembly
|
||||
/// </summary>
|
||||
public List<string> TypesToIgnore { get; set; }
|
||||
public List<string> TypesToIgnore
|
||||
{
|
||||
get { return _typesToIgnore; }
|
||||
set
|
||||
{
|
||||
_typesToIgnore = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> _tokensToMatch;
|
||||
|
||||
/// <summary>
|
||||
/// The auto mapper will look for these tokens in class names and prioritize those
|
||||
/// </summary>
|
||||
public List<string> TokensToMatch { get; set; }
|
||||
public List<string> TokensToMatch
|
||||
{
|
||||
get { return _tokensToMatch; }
|
||||
set
|
||||
{
|
||||
_tokensToMatch = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> _propertyFieldBlacklist;
|
||||
|
||||
/// <summary>
|
||||
/// Property or fields names to ignore in the automap, these are case sanitized so case does not matter
|
||||
/// </summary>
|
||||
public List<string> PropertyFieldBlackList { get; set; }
|
||||
public List<string> PropertyFieldBlackList
|
||||
{
|
||||
get { return _propertyFieldBlacklist; }
|
||||
set
|
||||
{
|
||||
_propertyFieldBlacklist = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> _methodParamaterBlackList;
|
||||
|
||||
/// <summary>
|
||||
/// method parameter names to ignore in the automap, these are case sanitized so case does not matter
|
||||
/// </summary>
|
||||
public List<string> MethodParamaterBlackList { get; set; }
|
||||
public List<string> MethodParamaterBlackList
|
||||
{
|
||||
get { return _methodParamaterBlackList; }
|
||||
set
|
||||
{
|
||||
_methodParamaterBlackList = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -109,15 +343,40 @@ public class AutoMapperSettings
|
||||
/// </summary>
|
||||
public class CrossCompilerSettings
|
||||
{
|
||||
private string _lastLoadedProject;
|
||||
|
||||
/// <summary>
|
||||
/// Last Loaded Project Path
|
||||
/// </summary>
|
||||
public string LastLoadedProject { get; set; }
|
||||
public string LastLoadedProject
|
||||
{
|
||||
get { return _lastLoadedProject; }
|
||||
set
|
||||
{
|
||||
_lastLoadedProject = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _autoLoadLastActiveProj;
|
||||
|
||||
/// <summary>
|
||||
/// Should the last active project be auto loaded
|
||||
/// </summary>
|
||||
public bool AutoLoadLastActiveProject { get; set; }
|
||||
public bool AutoLoadLastActiveProject
|
||||
{
|
||||
get { return _autoLoadLastActiveProj; }
|
||||
set
|
||||
{
|
||||
_autoLoadLastActiveProj = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -125,23 +384,68 @@ public class CrossCompilerSettings
|
||||
/// </summary>
|
||||
public class MappingSettings
|
||||
{
|
||||
private bool _renameFields;
|
||||
|
||||
/// <summary>
|
||||
/// Names of fields of the matched type will be renamed to the type name with approproiate convention
|
||||
/// </summary>
|
||||
public bool RenameFields { get; set; }
|
||||
public bool RenameFields
|
||||
{
|
||||
get { return _renameFields; }
|
||||
set
|
||||
{
|
||||
_renameFields = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _renameProps;
|
||||
|
||||
/// <summary>
|
||||
/// Names of properties of the matched type will be renamed to the type name with approproiate convention
|
||||
/// </summary>
|
||||
public bool RenameProperties { get; set; }
|
||||
public bool RenameProperties
|
||||
{
|
||||
get { return _renameProps; }
|
||||
set
|
||||
{
|
||||
_renameProps = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _publicize;
|
||||
|
||||
/// <summary>
|
||||
/// Publicize all types, methods, and properties : NOTE: Not run until after the remap has completed
|
||||
/// </summary>
|
||||
public bool Publicize { get; set; }
|
||||
public bool Publicize
|
||||
{
|
||||
get { return _publicize; }
|
||||
set
|
||||
{
|
||||
_unseal = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private bool _unseal;
|
||||
|
||||
/// <summary>
|
||||
/// Unseal all types : NOTE: Not run until after the remap has completed
|
||||
/// </summary>
|
||||
public bool Unseal { get; set; }
|
||||
public bool Unseal
|
||||
{
|
||||
get { return _unseal; }
|
||||
set
|
||||
{
|
||||
_unseal = value;
|
||||
Save();
|
||||
}
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
DataProvider.SaveAppSettings();
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace ReCodeIt.Utils;
|
||||
|
||||
internal static class StringExtentions
|
||||
public static class SysTypeExtentions
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns a string trimmed after any non letter character
|
||||
@ -40,8 +40,7 @@ internal static class StringExtentions
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does the property or field name exist in a given list, this applies prefixes and handles
|
||||
/// capitalization.
|
||||
/// Does the property or field name exist in a given list, this applies prefixes and handles capitalization.
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="list"></param>
|
Loading…
x
Reference in New Issue
Block a user