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