More gui work, add console project
This commit is contained in:
parent
ba71021665
commit
ce44344247
@ -12,4 +12,8 @@
|
|||||||
<PackageReference Include="morelinq" Version="4.2.0" />
|
<PackageReference Include="morelinq" Version="4.2.0" />
|
||||||
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="AutoMapper\" />
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@ -15,26 +15,25 @@ public class AppSettings
|
|||||||
{
|
{
|
||||||
public bool Debug { get; set; } = false;
|
public bool Debug { get; set; } = false;
|
||||||
public bool SilentMode { get; set; } = true;
|
public bool SilentMode { get; set; } = true;
|
||||||
public bool MatchMode { get; set; } = false;
|
public string AssemblyPath { get; set; } = string.Empty;
|
||||||
|
public string OutputPath { get; set; } = string.Empty;
|
||||||
|
public string MappingPath { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
public bool RenameFields { get; set; } = true;
|
||||||
|
public bool RenameProperties { get; set; } = true;
|
||||||
|
|
||||||
|
public bool Publicize { get; set; } = false;
|
||||||
|
public bool Unseal { get; set; } = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RemapperSettings
|
public class RemapperSettings
|
||||||
{
|
{
|
||||||
public int MaxMatchCount { get; set; } = 5;
|
public int MaxMatchCount { get; set; } = 5;
|
||||||
|
|
||||||
public bool Publicize { get; set; } = false;
|
|
||||||
public bool Unseal { get; set; } = false;
|
|
||||||
|
|
||||||
public string AssemblyPath { get; set; } = string.Empty;
|
|
||||||
public string OutputPath { get; set; } = string.Empty;
|
|
||||||
public string MappingPath { get; set; } = string.Empty;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AutoMapperSettings
|
public class AutoMapperSettings
|
||||||
{
|
{
|
||||||
public int RequiredMatches { get; set; } = 5;
|
public int RequiredMatches { get; set; } = 5;
|
||||||
public bool MatchMode { get; set; } = true;
|
|
||||||
public bool Publicize { get; set; } = false;
|
|
||||||
public bool Unseal { get; set; } = false;
|
|
||||||
public List<string> NamesToIgnore { get; set; } = [];
|
public List<string> NamesToIgnore { get; set; } = [];
|
||||||
}
|
}
|
@ -36,12 +36,6 @@ public class Remapper
|
|||||||
|
|
||||||
ChooseBestMatches();
|
ChooseBestMatches();
|
||||||
|
|
||||||
if (DataProvider.Settings.AppSettings.MatchMode)
|
|
||||||
{
|
|
||||||
IsRunning = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Dont publicize and unseal until after the remapping so we can use those as search parameters
|
// Dont publicize and unseal until after the remapping so we can use those as search parameters
|
||||||
if (!DataProvider.Settings.Remapper.Publicize)
|
if (!DataProvider.Settings.Remapper.Publicize)
|
||||||
{
|
{
|
||||||
@ -229,8 +223,6 @@ public class Remapper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DataProvider.Settings.AppSettings.MatchMode) { return; }
|
|
||||||
|
|
||||||
highestScore.ReMap.OriginalTypeName = highestScore.Definition.Name;
|
highestScore.ReMap.OriginalTypeName = highestScore.Definition.Name;
|
||||||
|
|
||||||
// Rename type and all associated type members
|
// Rename type and all associated type members
|
||||||
@ -244,7 +236,7 @@ public class Remapper
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void WriteAssembly()
|
private void WriteAssembly()
|
||||||
{
|
{
|
||||||
var filename = Path.GetFileNameWithoutExtension(DataProvider.Settings.Remapper.AssemblyPath);
|
var filename = Path.GetFileNameWithoutExtension(DataProvider.Settings.AppSettings.AssemblyPath);
|
||||||
var strippedPath = Path.GetDirectoryName(filename);
|
var strippedPath = Path.GetDirectoryName(filename);
|
||||||
|
|
||||||
filename = $"{filename}-Remapped.dll";
|
filename = $"{filename}-Remapped.dll";
|
||||||
|
@ -26,7 +26,7 @@ public static class DataProvider
|
|||||||
|
|
||||||
if (!File.Exists(settingsPath))
|
if (!File.Exists(settingsPath))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"path `{settingsPath}` does not exist...");
|
throw new FileNotFoundException($"path `{settingsPath}` does not exist...");
|
||||||
}
|
}
|
||||||
|
|
||||||
var jsonText = File.ReadAllText(settingsPath);
|
var jsonText = File.ReadAllText(settingsPath);
|
||||||
@ -41,15 +41,29 @@ public static class DataProvider
|
|||||||
Logger.Log($"Settings loaded from '{settingsPath}'");
|
Logger.Log($"Settings loaded from '{settingsPath}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void SaveAppSettings()
|
||||||
|
{
|
||||||
|
var settingsPath = Path.Combine(AppContext.BaseDirectory, "Data", "Settings.jsonc");
|
||||||
|
|
||||||
|
if (!File.Exists(settingsPath))
|
||||||
|
{
|
||||||
|
throw new FileNotFoundException($"path `{settingsPath}` does not exist...");
|
||||||
|
}
|
||||||
|
|
||||||
|
var jsonText = JsonConvert.SerializeObject(Settings);
|
||||||
|
|
||||||
|
File.WriteAllText(settingsPath, jsonText);
|
||||||
|
}
|
||||||
|
|
||||||
public static void LoadMappingFile(string path = "")
|
public static void LoadMappingFile(string path = "")
|
||||||
{
|
{
|
||||||
if (!File.Exists(Settings.Remapper.MappingPath))
|
if (!File.Exists(Settings.AppSettings.MappingPath))
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException($"path `{Settings.Remapper.MappingPath}` does not exist...");
|
throw new InvalidOperationException($"path `{Settings.AppSettings.MappingPath}` does not exist...");
|
||||||
}
|
}
|
||||||
|
|
||||||
var fpath = path == string.Empty
|
var fpath = path == string.Empty
|
||||||
? Settings.Remapper.MappingPath
|
? Settings.AppSettings.MappingPath
|
||||||
: path;
|
: path;
|
||||||
|
|
||||||
var jsonText = File.ReadAllText(fpath);
|
var jsonText = File.ReadAllText(fpath);
|
||||||
@ -72,7 +86,7 @@ public static class DataProvider
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Logger.Log($"Mapping file loaded from '{Settings.Remapper.MappingPath}'");
|
Logger.Log($"Mapping file loaded from '{Settings.AppSettings.MappingPath}'");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SaveMapping()
|
public static void SaveMapping()
|
||||||
@ -85,14 +99,14 @@ public static class DataProvider
|
|||||||
|
|
||||||
var jsonText = JsonConvert.SerializeObject(Remaps, settings);
|
var jsonText = JsonConvert.SerializeObject(Remaps, settings);
|
||||||
|
|
||||||
File.WriteAllText(Settings.Remapper.MappingPath, jsonText);
|
File.WriteAllText(Settings.AppSettings.MappingPath, jsonText);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void UpdateMapping()
|
public static void UpdateMapping()
|
||||||
{
|
{
|
||||||
if (!File.Exists(Settings.Remapper.MappingPath))
|
if (!File.Exists(Settings.AppSettings.MappingPath))
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException($"path `{Settings.Remapper.MappingPath}` does not exist...");
|
throw new FileNotFoundException($"path `{Settings.AppSettings.MappingPath}` does not exist...");
|
||||||
}
|
}
|
||||||
|
|
||||||
JsonSerializerSettings settings = new()
|
JsonSerializerSettings settings = new()
|
||||||
@ -120,9 +134,9 @@ public static class DataProvider
|
|||||||
|
|
||||||
var jsonText = JsonConvert.SerializeObject(Remaps, settings);
|
var jsonText = JsonConvert.SerializeObject(Remaps, settings);
|
||||||
|
|
||||||
File.WriteAllText(Settings.Remapper.MappingPath, jsonText);
|
File.WriteAllText(Settings.AppSettings.MappingPath, jsonText);
|
||||||
|
|
||||||
Logger.Log($"Mapping file saved to {Settings.Remapper.MappingPath}");
|
Logger.Log($"Mapping file saved to {Settings.AppSettings.MappingPath}");
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LoadAssemblyDefinition()
|
public static void LoadAssemblyDefinition()
|
||||||
@ -131,17 +145,17 @@ public static class DataProvider
|
|||||||
ModuleDefinition = null;
|
ModuleDefinition = null;
|
||||||
|
|
||||||
DefaultAssemblyResolver resolver = new();
|
DefaultAssemblyResolver resolver = new();
|
||||||
resolver.AddSearchDirectory(Path.GetDirectoryName(Settings.Remapper.AssemblyPath)); // Replace with the correct path : (6/14) I have no idea what I met by that
|
resolver.AddSearchDirectory(Path.GetDirectoryName(Settings.AppSettings.AssemblyPath)); // Replace with the correct path : (6/14) I have no idea what I met by that
|
||||||
ReaderParameters parameters = new() { AssemblyResolver = resolver };
|
ReaderParameters parameters = new() { AssemblyResolver = resolver };
|
||||||
|
|
||||||
AssemblyDefinition = AssemblyDefinition.ReadAssembly(Settings.Remapper.AssemblyPath, parameters);
|
AssemblyDefinition = AssemblyDefinition.ReadAssembly(Settings.AppSettings.AssemblyPath, parameters);
|
||||||
|
|
||||||
if (AssemblyDefinition is null)
|
if (AssemblyDefinition is null)
|
||||||
{
|
{
|
||||||
throw new NullReferenceException("AssemblyDefinition was null...");
|
throw new NullReferenceException("AssemblyDefinition was null...");
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileName = Path.GetFileName(Settings.Remapper.AssemblyPath);
|
var fileName = Path.GetFileName(Settings.AppSettings.AssemblyPath);
|
||||||
|
|
||||||
foreach (var module in AssemblyDefinition.Modules.ToArray())
|
foreach (var module in AssemblyDefinition.Modules.ToArray())
|
||||||
{
|
{
|
||||||
|
294
AssemblyRemapperGUI/Form1.Designer.cs
generated
294
AssemblyRemapperGUI/Form1.Designer.cs
generated
@ -101,7 +101,29 @@ partial class AssemblyToolGUI
|
|||||||
MethodCountEnabled = new CheckBox();
|
MethodCountEnabled = new CheckBox();
|
||||||
IsSealedUpDown = new DomainUpDown();
|
IsSealedUpDown = new DomainUpDown();
|
||||||
TabControlMain = new TabControl();
|
TabControlMain = new TabControl();
|
||||||
|
tabPage5 = new TabPage();
|
||||||
|
groupBox3 = new GroupBox();
|
||||||
|
label1 = new Label();
|
||||||
|
MaxMatchCountUpDown = new NumericUpDown();
|
||||||
|
groupBox4 = new GroupBox();
|
||||||
|
label2 = new Label();
|
||||||
|
AutoMapperRequiredMatchesUpDown = new NumericUpDown();
|
||||||
|
groupBox2 = new GroupBox();
|
||||||
|
MappingChooseButton = new Button();
|
||||||
|
UnsealCheckbox = new CheckBox();
|
||||||
|
RenamePropertiesCheckbox = new CheckBox();
|
||||||
|
PublicizeCheckbox = new CheckBox();
|
||||||
|
OutputDirectoryButton = new Button();
|
||||||
|
RenameFieldsCheckbox = new CheckBox();
|
||||||
|
PickAssemblyPathButton = new Button();
|
||||||
|
MappingPathTextBox = new TextBox();
|
||||||
|
OutputPathTextBox = new TextBox();
|
||||||
|
AssemblyPathTextBox = new TextBox();
|
||||||
|
SilentModeCheckbox = new CheckBox();
|
||||||
|
DebugLoggingCheckbox = new CheckBox();
|
||||||
colorDialog1 = new ColorDialog();
|
colorDialog1 = new ColorDialog();
|
||||||
|
openFileDialog1 = new OpenFileDialog();
|
||||||
|
fileSystemWatcher1 = new FileSystemWatcher();
|
||||||
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit();
|
((System.ComponentModel.ISupportInitialize)bindingSource1).BeginInit();
|
||||||
TabPageRemapper.SuspendLayout();
|
TabPageRemapper.SuspendLayout();
|
||||||
groupBox1.SuspendLayout();
|
groupBox1.SuspendLayout();
|
||||||
@ -116,6 +138,13 @@ partial class AssemblyToolGUI
|
|||||||
((System.ComponentModel.ISupportInitialize)MethodCountUpDown).BeginInit();
|
((System.ComponentModel.ISupportInitialize)MethodCountUpDown).BeginInit();
|
||||||
((System.ComponentModel.ISupportInitialize)NestedTypeCountUpDown).BeginInit();
|
((System.ComponentModel.ISupportInitialize)NestedTypeCountUpDown).BeginInit();
|
||||||
TabControlMain.SuspendLayout();
|
TabControlMain.SuspendLayout();
|
||||||
|
tabPage5.SuspendLayout();
|
||||||
|
groupBox3.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)MaxMatchCountUpDown).BeginInit();
|
||||||
|
groupBox4.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)AutoMapperRequiredMatchesUpDown).BeginInit();
|
||||||
|
groupBox2.SuspendLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)fileSystemWatcher1).BeginInit();
|
||||||
SuspendLayout();
|
SuspendLayout();
|
||||||
//
|
//
|
||||||
// TabPageRemapper
|
// TabPageRemapper
|
||||||
@ -827,12 +856,245 @@ partial class AssemblyToolGUI
|
|||||||
// TabControlMain
|
// TabControlMain
|
||||||
//
|
//
|
||||||
TabControlMain.Controls.Add(TabPageRemapper);
|
TabControlMain.Controls.Add(TabPageRemapper);
|
||||||
|
TabControlMain.Controls.Add(tabPage5);
|
||||||
TabControlMain.Location = new Point(-5, 1);
|
TabControlMain.Location = new Point(-5, 1);
|
||||||
TabControlMain.Name = "TabControlMain";
|
TabControlMain.Name = "TabControlMain";
|
||||||
TabControlMain.SelectedIndex = 0;
|
TabControlMain.SelectedIndex = 0;
|
||||||
TabControlMain.Size = new Size(1344, 991);
|
TabControlMain.Size = new Size(1344, 991);
|
||||||
TabControlMain.TabIndex = 6;
|
TabControlMain.TabIndex = 6;
|
||||||
//
|
//
|
||||||
|
// tabPage5
|
||||||
|
//
|
||||||
|
tabPage5.BackColor = SystemColors.ControlDarkDark;
|
||||||
|
tabPage5.Controls.Add(groupBox3);
|
||||||
|
tabPage5.Controls.Add(groupBox4);
|
||||||
|
tabPage5.Controls.Add(groupBox2);
|
||||||
|
tabPage5.Location = new Point(4, 34);
|
||||||
|
tabPage5.Name = "tabPage5";
|
||||||
|
tabPage5.Padding = new Padding(3);
|
||||||
|
tabPage5.Size = new Size(1336, 953);
|
||||||
|
tabPage5.TabIndex = 2;
|
||||||
|
tabPage5.Text = "Settings";
|
||||||
|
//
|
||||||
|
// groupBox3
|
||||||
|
//
|
||||||
|
groupBox3.Controls.Add(label1);
|
||||||
|
groupBox3.Controls.Add(MaxMatchCountUpDown);
|
||||||
|
groupBox3.Location = new Point(464, 6);
|
||||||
|
groupBox3.Name = "groupBox3";
|
||||||
|
groupBox3.Size = new Size(259, 285);
|
||||||
|
groupBox3.TabIndex = 1;
|
||||||
|
groupBox3.TabStop = false;
|
||||||
|
groupBox3.Text = "Remapper Settings";
|
||||||
|
//
|
||||||
|
// label1
|
||||||
|
//
|
||||||
|
label1.AutoSize = true;
|
||||||
|
label1.Location = new Point(69, 37);
|
||||||
|
label1.Name = "label1";
|
||||||
|
label1.Size = new Size(152, 25);
|
||||||
|
label1.TabIndex = 5;
|
||||||
|
label1.Text = "Max Match Count";
|
||||||
|
//
|
||||||
|
// MaxMatchCountUpDown
|
||||||
|
//
|
||||||
|
MaxMatchCountUpDown.Location = new Point(6, 35);
|
||||||
|
MaxMatchCountUpDown.Minimum = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
MaxMatchCountUpDown.Name = "MaxMatchCountUpDown";
|
||||||
|
MaxMatchCountUpDown.Size = new Size(57, 31);
|
||||||
|
MaxMatchCountUpDown.TabIndex = 0;
|
||||||
|
MaxMatchCountUpDown.Value = new decimal(new int[] { 1, 0, 0, 0 });
|
||||||
|
MaxMatchCountUpDown.ValueChanged += MaxMatchCountUpDown_ValueChanged;
|
||||||
|
//
|
||||||
|
// groupBox4
|
||||||
|
//
|
||||||
|
groupBox4.Controls.Add(label2);
|
||||||
|
groupBox4.Controls.Add(AutoMapperRequiredMatchesUpDown);
|
||||||
|
groupBox4.Location = new Point(729, 6);
|
||||||
|
groupBox4.Name = "groupBox4";
|
||||||
|
groupBox4.Size = new Size(557, 285);
|
||||||
|
groupBox4.TabIndex = 1;
|
||||||
|
groupBox4.TabStop = false;
|
||||||
|
groupBox4.Text = "Auto Mapper Settings";
|
||||||
|
//
|
||||||
|
// label2
|
||||||
|
//
|
||||||
|
label2.AutoSize = true;
|
||||||
|
label2.Location = new Point(69, 37);
|
||||||
|
label2.Name = "label2";
|
||||||
|
label2.Size = new Size(153, 25);
|
||||||
|
label2.TabIndex = 6;
|
||||||
|
label2.Text = "Required Matches";
|
||||||
|
//
|
||||||
|
// AutoMapperRequiredMatchesUpDown
|
||||||
|
//
|
||||||
|
AutoMapperRequiredMatchesUpDown.Location = new Point(6, 35);
|
||||||
|
AutoMapperRequiredMatchesUpDown.Name = "AutoMapperRequiredMatchesUpDown";
|
||||||
|
AutoMapperRequiredMatchesUpDown.Size = new Size(57, 31);
|
||||||
|
AutoMapperRequiredMatchesUpDown.TabIndex = 5;
|
||||||
|
AutoMapperRequiredMatchesUpDown.ValueChanged += AutoMapperRequiredMatchesUpDown_ValueChanged;
|
||||||
|
//
|
||||||
|
// groupBox2
|
||||||
|
//
|
||||||
|
groupBox2.Controls.Add(MappingChooseButton);
|
||||||
|
groupBox2.Controls.Add(UnsealCheckbox);
|
||||||
|
groupBox2.Controls.Add(RenamePropertiesCheckbox);
|
||||||
|
groupBox2.Controls.Add(PublicizeCheckbox);
|
||||||
|
groupBox2.Controls.Add(OutputDirectoryButton);
|
||||||
|
groupBox2.Controls.Add(RenameFieldsCheckbox);
|
||||||
|
groupBox2.Controls.Add(PickAssemblyPathButton);
|
||||||
|
groupBox2.Controls.Add(MappingPathTextBox);
|
||||||
|
groupBox2.Controls.Add(OutputPathTextBox);
|
||||||
|
groupBox2.Controls.Add(AssemblyPathTextBox);
|
||||||
|
groupBox2.Controls.Add(SilentModeCheckbox);
|
||||||
|
groupBox2.Controls.Add(DebugLoggingCheckbox);
|
||||||
|
groupBox2.Location = new Point(13, 6);
|
||||||
|
groupBox2.Name = "groupBox2";
|
||||||
|
groupBox2.Size = new Size(445, 285);
|
||||||
|
groupBox2.TabIndex = 0;
|
||||||
|
groupBox2.TabStop = false;
|
||||||
|
groupBox2.Text = "App Settings";
|
||||||
|
//
|
||||||
|
// MappingChooseButton
|
||||||
|
//
|
||||||
|
MappingChooseButton.Location = new Point(308, 171);
|
||||||
|
MappingChooseButton.Name = "MappingChooseButton";
|
||||||
|
MappingChooseButton.Size = new Size(112, 34);
|
||||||
|
MappingChooseButton.TabIndex = 8;
|
||||||
|
MappingChooseButton.Text = "Choose";
|
||||||
|
MappingChooseButton.UseVisualStyleBackColor = true;
|
||||||
|
MappingChooseButton.Click += MappingChooseButton_Click;
|
||||||
|
//
|
||||||
|
// UnsealCheckbox
|
||||||
|
//
|
||||||
|
UnsealCheckbox.AutoSize = true;
|
||||||
|
UnsealCheckbox.Checked = true;
|
||||||
|
UnsealCheckbox.CheckState = CheckState.Checked;
|
||||||
|
UnsealCheckbox.Location = new Point(196, 246);
|
||||||
|
UnsealCheckbox.Name = "UnsealCheckbox";
|
||||||
|
UnsealCheckbox.Size = new Size(90, 29);
|
||||||
|
UnsealCheckbox.TabIndex = 2;
|
||||||
|
UnsealCheckbox.Text = "Unseal";
|
||||||
|
UnsealCheckbox.UseVisualStyleBackColor = true;
|
||||||
|
UnsealCheckbox.CheckedChanged += UnsealCheckbox_CheckedChanged;
|
||||||
|
//
|
||||||
|
// RenamePropertiesCheckbox
|
||||||
|
//
|
||||||
|
RenamePropertiesCheckbox.AutoSize = true;
|
||||||
|
RenamePropertiesCheckbox.Checked = true;
|
||||||
|
RenamePropertiesCheckbox.CheckState = CheckState.Checked;
|
||||||
|
RenamePropertiesCheckbox.Location = new Point(6, 246);
|
||||||
|
RenamePropertiesCheckbox.Name = "RenamePropertiesCheckbox";
|
||||||
|
RenamePropertiesCheckbox.Size = new Size(186, 29);
|
||||||
|
RenamePropertiesCheckbox.TabIndex = 4;
|
||||||
|
RenamePropertiesCheckbox.Text = "Rename Properties";
|
||||||
|
RenamePropertiesCheckbox.UseVisualStyleBackColor = true;
|
||||||
|
RenamePropertiesCheckbox.CheckedChanged += RenamePropertiesCheckbox_CheckedChanged;
|
||||||
|
//
|
||||||
|
// PublicizeCheckbox
|
||||||
|
//
|
||||||
|
PublicizeCheckbox.AutoSize = true;
|
||||||
|
PublicizeCheckbox.Checked = true;
|
||||||
|
PublicizeCheckbox.CheckState = CheckState.Checked;
|
||||||
|
PublicizeCheckbox.Location = new Point(196, 211);
|
||||||
|
PublicizeCheckbox.Name = "PublicizeCheckbox";
|
||||||
|
PublicizeCheckbox.Size = new Size(106, 29);
|
||||||
|
PublicizeCheckbox.TabIndex = 1;
|
||||||
|
PublicizeCheckbox.Text = "Publicize";
|
||||||
|
PublicizeCheckbox.UseVisualStyleBackColor = true;
|
||||||
|
PublicizeCheckbox.CheckedChanged += PublicizeCheckbox_CheckedChanged;
|
||||||
|
//
|
||||||
|
// OutputDirectoryButton
|
||||||
|
//
|
||||||
|
OutputDirectoryButton.Location = new Point(308, 134);
|
||||||
|
OutputDirectoryButton.Name = "OutputDirectoryButton";
|
||||||
|
OutputDirectoryButton.Size = new Size(112, 34);
|
||||||
|
OutputDirectoryButton.TabIndex = 7;
|
||||||
|
OutputDirectoryButton.Text = "Choose";
|
||||||
|
OutputDirectoryButton.UseVisualStyleBackColor = true;
|
||||||
|
OutputDirectoryButton.Click += OutputDirectoryButton_Click;
|
||||||
|
//
|
||||||
|
// RenameFieldsCheckbox
|
||||||
|
//
|
||||||
|
RenameFieldsCheckbox.AutoSize = true;
|
||||||
|
RenameFieldsCheckbox.Checked = true;
|
||||||
|
RenameFieldsCheckbox.CheckState = CheckState.Checked;
|
||||||
|
RenameFieldsCheckbox.Location = new Point(6, 211);
|
||||||
|
RenameFieldsCheckbox.Name = "RenameFieldsCheckbox";
|
||||||
|
RenameFieldsCheckbox.Size = new Size(151, 29);
|
||||||
|
RenameFieldsCheckbox.TabIndex = 3;
|
||||||
|
RenameFieldsCheckbox.Text = "Rename Fields";
|
||||||
|
RenameFieldsCheckbox.UseVisualStyleBackColor = true;
|
||||||
|
RenameFieldsCheckbox.CheckedChanged += RenameFieldsCheckbox_CheckedChanged;
|
||||||
|
//
|
||||||
|
// PickAssemblyPathButton
|
||||||
|
//
|
||||||
|
PickAssemblyPathButton.Location = new Point(308, 100);
|
||||||
|
PickAssemblyPathButton.Name = "PickAssemblyPathButton";
|
||||||
|
PickAssemblyPathButton.Size = new Size(112, 34);
|
||||||
|
PickAssemblyPathButton.TabIndex = 6;
|
||||||
|
PickAssemblyPathButton.Text = "Choose";
|
||||||
|
PickAssemblyPathButton.UseVisualStyleBackColor = true;
|
||||||
|
PickAssemblyPathButton.Click += PickAssemblyPathButton_Click;
|
||||||
|
//
|
||||||
|
// MappingPathTextBox
|
||||||
|
//
|
||||||
|
MappingPathTextBox.Location = new Point(6, 174);
|
||||||
|
MappingPathTextBox.Name = "MappingPathTextBox";
|
||||||
|
MappingPathTextBox.PlaceholderText = "Mapping.json path";
|
||||||
|
MappingPathTextBox.ReadOnly = true;
|
||||||
|
MappingPathTextBox.Size = new Size(296, 31);
|
||||||
|
MappingPathTextBox.TabIndex = 5;
|
||||||
|
//
|
||||||
|
// OutputPathTextBox
|
||||||
|
//
|
||||||
|
OutputPathTextBox.Location = new Point(6, 137);
|
||||||
|
OutputPathTextBox.Name = "OutputPathTextBox";
|
||||||
|
OutputPathTextBox.PlaceholderText = "Output Directory";
|
||||||
|
OutputPathTextBox.ReadOnly = true;
|
||||||
|
OutputPathTextBox.Size = new Size(296, 31);
|
||||||
|
OutputPathTextBox.TabIndex = 4;
|
||||||
|
//
|
||||||
|
// AssemblyPathTextBox
|
||||||
|
//
|
||||||
|
AssemblyPathTextBox.Location = new Point(6, 100);
|
||||||
|
AssemblyPathTextBox.Name = "AssemblyPathTextBox";
|
||||||
|
AssemblyPathTextBox.PlaceholderText = "Assembly Path (Including file name)";
|
||||||
|
AssemblyPathTextBox.ReadOnly = true;
|
||||||
|
AssemblyPathTextBox.Size = new Size(296, 31);
|
||||||
|
AssemblyPathTextBox.TabIndex = 3;
|
||||||
|
//
|
||||||
|
// SilentModeCheckbox
|
||||||
|
//
|
||||||
|
SilentModeCheckbox.AutoSize = true;
|
||||||
|
SilentModeCheckbox.Location = new Point(6, 65);
|
||||||
|
SilentModeCheckbox.Name = "SilentModeCheckbox";
|
||||||
|
SilentModeCheckbox.Size = new Size(133, 29);
|
||||||
|
SilentModeCheckbox.TabIndex = 2;
|
||||||
|
SilentModeCheckbox.Text = "Silent Mode";
|
||||||
|
SilentModeCheckbox.UseVisualStyleBackColor = true;
|
||||||
|
SilentModeCheckbox.CheckedChanged += SilentModeCheckbox_CheckedChanged;
|
||||||
|
//
|
||||||
|
// DebugLoggingCheckbox
|
||||||
|
//
|
||||||
|
DebugLoggingCheckbox.AutoSize = true;
|
||||||
|
DebugLoggingCheckbox.Location = new Point(6, 30);
|
||||||
|
DebugLoggingCheckbox.Name = "DebugLoggingCheckbox";
|
||||||
|
DebugLoggingCheckbox.Size = new Size(159, 29);
|
||||||
|
DebugLoggingCheckbox.TabIndex = 0;
|
||||||
|
DebugLoggingCheckbox.Text = "Debug logging";
|
||||||
|
DebugLoggingCheckbox.UseVisualStyleBackColor = true;
|
||||||
|
DebugLoggingCheckbox.CheckedChanged += DebugLoggingCheckbox_CheckedChanged;
|
||||||
|
//
|
||||||
|
// openFileDialog1
|
||||||
|
//
|
||||||
|
openFileDialog1.FileName = "openFileDialog1";
|
||||||
|
//
|
||||||
|
// fileSystemWatcher1
|
||||||
|
//
|
||||||
|
fileSystemWatcher1.EnableRaisingEvents = true;
|
||||||
|
fileSystemWatcher1.SynchronizingObject = this;
|
||||||
|
//
|
||||||
// AssemblyToolGUI
|
// AssemblyToolGUI
|
||||||
//
|
//
|
||||||
AutoScaleDimensions = new SizeF(10F, 25F);
|
AutoScaleDimensions = new SizeF(10F, 25F);
|
||||||
@ -862,6 +1124,16 @@ partial class AssemblyToolGUI
|
|||||||
((System.ComponentModel.ISupportInitialize)MethodCountUpDown).EndInit();
|
((System.ComponentModel.ISupportInitialize)MethodCountUpDown).EndInit();
|
||||||
((System.ComponentModel.ISupportInitialize)NestedTypeCountUpDown).EndInit();
|
((System.ComponentModel.ISupportInitialize)NestedTypeCountUpDown).EndInit();
|
||||||
TabControlMain.ResumeLayout(false);
|
TabControlMain.ResumeLayout(false);
|
||||||
|
tabPage5.ResumeLayout(false);
|
||||||
|
groupBox3.ResumeLayout(false);
|
||||||
|
groupBox3.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)MaxMatchCountUpDown).EndInit();
|
||||||
|
groupBox4.ResumeLayout(false);
|
||||||
|
groupBox4.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)AutoMapperRequiredMatchesUpDown).EndInit();
|
||||||
|
groupBox2.ResumeLayout(false);
|
||||||
|
groupBox2.PerformLayout();
|
||||||
|
((System.ComponentModel.ISupportInitialize)fileSystemWatcher1).EndInit();
|
||||||
ResumeLayout(false);
|
ResumeLayout(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -940,4 +1212,26 @@ partial class AssemblyToolGUI
|
|||||||
private CheckBox ConstructorCountEnabled;
|
private CheckBox ConstructorCountEnabled;
|
||||||
private NumericUpDown MethodCountUpDown;
|
private NumericUpDown MethodCountUpDown;
|
||||||
private CheckBox MethodCountEnabled;
|
private CheckBox MethodCountEnabled;
|
||||||
|
private TabPage tabPage5;
|
||||||
|
private GroupBox groupBox3;
|
||||||
|
private GroupBox groupBox4;
|
||||||
|
private GroupBox groupBox2;
|
||||||
|
private CheckBox SilentModeCheckbox;
|
||||||
|
private CheckBox DebugLoggingCheckbox;
|
||||||
|
private Button MappingChooseButton;
|
||||||
|
private Button OutputDirectoryButton;
|
||||||
|
private Button PickAssemblyPathButton;
|
||||||
|
private TextBox MappingPathTextBox;
|
||||||
|
private TextBox OutputPathTextBox;
|
||||||
|
private TextBox AssemblyPathTextBox;
|
||||||
|
private OpenFileDialog openFileDialog1;
|
||||||
|
private FileSystemWatcher fileSystemWatcher1;
|
||||||
|
private CheckBox RenamePropertiesCheckbox;
|
||||||
|
private CheckBox RenameFieldsCheckbox;
|
||||||
|
private CheckBox UnsealCheckbox;
|
||||||
|
private CheckBox PublicizeCheckbox;
|
||||||
|
private NumericUpDown MaxMatchCountUpDown;
|
||||||
|
private NumericUpDown AutoMapperRequiredMatchesUpDown;
|
||||||
|
private Label label1;
|
||||||
|
private Label label2;
|
||||||
}
|
}
|
||||||
|
@ -4,354 +4,351 @@ using AssemblyRemapper.Remapper;
|
|||||||
using AssemblyRemapper.Utils;
|
using AssemblyRemapper.Utils;
|
||||||
using RemapperGUI.Utils;
|
using RemapperGUI.Utils;
|
||||||
|
|
||||||
namespace AssemblyRemapperGUI
|
namespace AssemblyRemapperGUI;
|
||||||
|
|
||||||
|
public partial class AssemblyToolGUI : Form
|
||||||
{
|
{
|
||||||
public partial class AssemblyToolGUI : Form
|
public static Remapper Remapper { get; private set; } = new();
|
||||||
|
|
||||||
|
public AssemblyToolGUI()
|
||||||
{
|
{
|
||||||
public static Remapper Remapper { get; private set; } = new();
|
InitializeComponent();
|
||||||
|
PopulateDomainUpDowns();
|
||||||
|
|
||||||
public AssemblyToolGUI()
|
Remapper.OnComplete += ReloadTreeView;
|
||||||
|
ReloadTreeView(this, EventArgs.Empty);
|
||||||
|
}
|
||||||
|
|
||||||
|
#region BUTTONS
|
||||||
|
|
||||||
|
#region MAIN_BUTTONS
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Construct a new remap when the button is pressed
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void AddRemapButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (NewTypeName.Text == string.Empty)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
MessageBox.Show("Please enter a new type name", "Invalid data");
|
||||||
PopulateDomainUpDowns();
|
return;
|
||||||
|
|
||||||
Remapper.OnComplete += ReloadTreeView;
|
|
||||||
ReloadTreeView(this, EventArgs.Empty);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region BUTTONS
|
var remap = new RemapModel
|
||||||
|
|
||||||
#region MAIN_BUTTONS
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Construct a new remap when the button is pressed
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void AddRemapButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
if (NewTypeName.Text == string.Empty)
|
Succeeded = false,
|
||||||
|
FailureReason = EFailureReason.None,
|
||||||
|
NewTypeName = NewTypeName.Text,
|
||||||
|
OriginalTypeName = OriginalTypeName.Text == string.Empty ? null : OriginalTypeName.Text,
|
||||||
|
UseForceRename = ForceRenameCheckbox.Checked,
|
||||||
|
SearchParams = new SearchParams
|
||||||
{
|
{
|
||||||
MessageBox.Show("Please enter a new type name", "Invalid data");
|
IsPublic = IsPublicUpDown.GetEnabled(),
|
||||||
return;
|
IsAbstract = IsAbstractUpDown.GetEnabled(),
|
||||||
|
IsInterface = IsInterfaceUpDown.GetEnabled(),
|
||||||
|
IsEnum = IsEnumUpDown.GetEnabled(),
|
||||||
|
IsNested = IsNestedUpDown.GetEnabled(),
|
||||||
|
IsSealed = IsSealedUpDown.GetEnabled(),
|
||||||
|
HasAttribute = HasAttributeUpDown.GetEnabled(),
|
||||||
|
IsDerived = IsDerivedUpDown.GetEnabled(),
|
||||||
|
HasGenericParameters = HasGenericParametersUpDown.GetEnabled(),
|
||||||
|
|
||||||
|
ParentName = NestedTypeParentName.Text == string.Empty
|
||||||
|
? null
|
||||||
|
: NestedTypeParentName.Text,
|
||||||
|
|
||||||
|
MatchBaseClass = BaseClassIncludeTextFIeld.Text == string.Empty
|
||||||
|
? null
|
||||||
|
: BaseClassIncludeTextFIeld.Text,
|
||||||
|
|
||||||
|
IgnoreBaseClass = BaseClassExcludeTextField.Text == string.Empty
|
||||||
|
? null
|
||||||
|
: BaseClassExcludeTextField.Text,
|
||||||
|
|
||||||
|
// Constructor - TODO
|
||||||
|
ConstructorParameterCount = ConstructorCountEnabled.GetCount(ConstuctorCountUpDown),
|
||||||
|
MethodCount = MethodCountEnabled.GetCount(MethodCountUpDown),
|
||||||
|
FieldCount = FieldCountEnabled.GetCount(FieldCountUpDown),
|
||||||
|
PropertyCount = PropertyCountEnabled.GetCount(PropertyCountUpDown),
|
||||||
|
NestedTypeCount = NestedTypeCountEnabled.GetCount(NestedTypeCountUpDown),
|
||||||
|
IncludeMethods = GUI.GetAllEntriesFromListBox(MethodIncludeBox),
|
||||||
|
ExcludeMethods = GUI.GetAllEntriesFromListBox(MethodExcludeBox),
|
||||||
|
IncludeFields = GUI.GetAllEntriesFromListBox(FieldIncludeBox),
|
||||||
|
ExcludeFields = GUI.GetAllEntriesFromListBox(FieldExcludeBox),
|
||||||
|
IncludeProperties = GUI.GetAllEntriesFromListBox(PropertiesIncludeBox),
|
||||||
|
ExcludeProperties = GUI.GetAllEntriesFromListBox(PropertiesExcludeBox),
|
||||||
|
IncludeNestedTypes = GUI.GetAllEntriesFromListBox(NestedTypesIncludeBox),
|
||||||
|
ExcludeNestedTypes = GUI.GetAllEntriesFromListBox(NestedTypesExcludeBox),
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
var remap = new RemapModel
|
RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this));
|
||||||
{
|
DataProvider.Remaps.Add(remap);
|
||||||
Succeeded = false,
|
ResetAll();
|
||||||
FailureReason = EFailureReason.None,
|
}
|
||||||
NewTypeName = NewTypeName.Text,
|
|
||||||
OriginalTypeName = OriginalTypeName.Text == string.Empty ? null : OriginalTypeName.Text,
|
|
||||||
UseForceRename = ForceRenameCheckbox.Checked,
|
|
||||||
SearchParams = new SearchParams
|
|
||||||
{
|
|
||||||
IsPublic = IsPublicUpDown.GetEnabled(),
|
|
||||||
IsAbstract = IsAbstractUpDown.GetEnabled(),
|
|
||||||
IsInterface = IsInterfaceUpDown.GetEnabled(),
|
|
||||||
IsEnum = IsEnumUpDown.GetEnabled(),
|
|
||||||
IsNested = IsNestedUpDown.GetEnabled(),
|
|
||||||
IsSealed = IsSealedUpDown.GetEnabled(),
|
|
||||||
HasAttribute = HasAttributeUpDown.GetEnabled(),
|
|
||||||
IsDerived = IsDerivedUpDown.GetEnabled(),
|
|
||||||
HasGenericParameters = HasGenericParametersUpDown.GetEnabled(),
|
|
||||||
|
|
||||||
ParentName = NestedTypeParentName.Text == string.Empty
|
private void RemoveRemapButton_Click(object sender, EventArgs e)
|
||||||
? null
|
{
|
||||||
: NestedTypeParentName.Text,
|
DataProvider.Remaps?.RemoveAt(RemapTreeView.SelectedNode.Index);
|
||||||
|
RemapTreeView.SelectedNode?.Remove();
|
||||||
|
}
|
||||||
|
|
||||||
MatchBaseClass = BaseClassIncludeTextFIeld.Text == string.Empty
|
private void RunRemapButton_Click(object sender, EventArgs e)
|
||||||
? null
|
{
|
||||||
: BaseClassIncludeTextFIeld.Text,
|
if (Remapper.IsRunning) { return; }
|
||||||
|
|
||||||
IgnoreBaseClass = BaseClassExcludeTextField.Text == string.Empty
|
Console.Clear();
|
||||||
? null
|
|
||||||
: BaseClassExcludeTextField.Text,
|
|
||||||
|
|
||||||
// Constructor - TODO
|
Remapper.InitializeRemap();
|
||||||
ConstructorParameterCount = ConstructorCountEnabled.GetCount(ConstuctorCountUpDown),
|
}
|
||||||
MethodCount = MethodCountEnabled.GetCount(MethodCountUpDown),
|
|
||||||
FieldCount = FieldCountEnabled.GetCount(FieldCountUpDown),
|
|
||||||
PropertyCount = PropertyCountEnabled.GetCount(PropertyCountUpDown),
|
|
||||||
NestedTypeCount = NestedTypeCountEnabled.GetCount(NestedTypeCountUpDown),
|
|
||||||
IncludeMethods = GUI.GetAllEntriesFromListBox(MethodIncludeBox),
|
|
||||||
ExcludeMethods = GUI.GetAllEntriesFromListBox(MethodExcludeBox),
|
|
||||||
IncludeFields = GUI.GetAllEntriesFromListBox(FieldIncludeBox),
|
|
||||||
ExcludeFields = GUI.GetAllEntriesFromListBox(FieldExcludeBox),
|
|
||||||
IncludeProperties = GUI.GetAllEntriesFromListBox(PropertiesIncludeBox),
|
|
||||||
ExcludeProperties = GUI.GetAllEntriesFromListBox(PropertiesExcludeBox),
|
|
||||||
IncludeNestedTypes = GUI.GetAllEntriesFromListBox(NestedTypesIncludeBox),
|
|
||||||
ExcludeNestedTypes = GUI.GetAllEntriesFromListBox(NestedTypesExcludeBox),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void LoadMappingFileButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var fDialog = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Title = "Select a mapping file",
|
||||||
|
Filter = "JSON Files (*.json)|*.json|JSONC Files (*.jsonc)|*.jsonc|All Files (*.*)|*.*",
|
||||||
|
Multiselect = false
|
||||||
|
};
|
||||||
|
|
||||||
|
if (fDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
DataProvider.LoadMappingFile(fDialog.FileName);
|
||||||
|
}
|
||||||
|
|
||||||
|
RemapTreeView.Nodes.Clear();
|
||||||
|
|
||||||
|
foreach (var remap in DataProvider.Remaps)
|
||||||
|
{
|
||||||
RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this));
|
RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this));
|
||||||
DataProvider.Remaps.Add(remap);
|
|
||||||
ResetAll();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void RemoveRemapButton_Click(object sender, EventArgs e)
|
#endregion MAIN_BUTTONS
|
||||||
|
|
||||||
|
#region LISTBOX_BUTTONS
|
||||||
|
|
||||||
|
private void MethodIncludeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!MethodIncludeBox.Items.Contains(IncludeMethodTextBox.Text))
|
||||||
{
|
{
|
||||||
DataProvider.Remaps?.RemoveAt(RemapTreeView.SelectedNode.Index);
|
MethodIncludeBox.Items.Add(IncludeMethodTextBox.Text);
|
||||||
RemapTreeView.SelectedNode?.Remove();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void RunRemapButton_Click(object sender, EventArgs e)
|
private void MethodIncludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MethodIncludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (Remapper.IsRunning) { return; }
|
MethodIncludeBox.Items.Remove(MethodIncludeBox.SelectedItem);
|
||||||
|
|
||||||
Console.Clear();
|
|
||||||
|
|
||||||
Remapper.InitializeRemap();
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void SaveMappingFileButton_Click(object sender, EventArgs e)
|
private void MethodExcludeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!MethodExcludeBox.Items.Contains(ExcludeMethodTextBox.Text))
|
||||||
{
|
{
|
||||||
if (MessageBox.Show(
|
MethodExcludeBox.Items.Add(ExcludeMethodTextBox.Text);
|
||||||
"Are you sure?",
|
|
||||||
"Confirmation",
|
|
||||||
MessageBoxButtons.YesNo,
|
|
||||||
MessageBoxIcon.Exclamation,
|
|
||||||
MessageBoxDefaultButton.Button2) == DialogResult.Yes)
|
|
||||||
{
|
|
||||||
DataProvider.SaveMapping();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void LoadMappingFileButton_Click(object sender, EventArgs e)
|
private void MethodExcludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (MethodExcludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
var fDialog = new OpenFileDialog
|
MethodExcludeBox.Items.Remove(MethodExcludeBox.SelectedItem);
|
||||||
{
|
|
||||||
Title = "Select a mapping file",
|
|
||||||
Filter = "JSON Files (*.json)|*.json|JSONC Files (*.jsonc)|*.jsonc|All Files (*.*)|*.*",
|
|
||||||
Multiselect = false
|
|
||||||
};
|
|
||||||
|
|
||||||
if (fDialog.ShowDialog() == DialogResult.OK)
|
|
||||||
{
|
|
||||||
var fileName = fDialog.FileName;
|
|
||||||
|
|
||||||
DataProvider.LoadMappingFile(fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
RemapTreeView.Nodes.Clear();
|
|
||||||
|
|
||||||
foreach (var remap in DataProvider.Remaps)
|
|
||||||
{
|
|
||||||
RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion MAIN_BUTTONS
|
private void FIeldIncludeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
#region LISTBOX_BUTTONS
|
if (!FieldIncludeBox.Items.Contains(FieldsIncludeTextInput.Text))
|
||||||
|
|
||||||
private void MethodIncludeAddButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
{
|
||||||
if (!MethodIncludeBox.Items.Contains(IncludeMethodTextBox.Text))
|
FieldIncludeBox.Items.Add(FieldsIncludeTextInput.Text);
|
||||||
{
|
|
||||||
MethodIncludeBox.Items.Add(IncludeMethodTextBox.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void MethodIncludeRemoveButton_Click(object sender, EventArgs e)
|
private void FieldIncludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (FieldIncludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (MethodIncludeBox.SelectedItem != null)
|
FieldIncludeBox.Items.Remove(FieldIncludeBox.SelectedItem);
|
||||||
{
|
|
||||||
MethodIncludeBox.Items.Remove(MethodIncludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void MethodExcludeAddButton_Click(object sender, EventArgs e)
|
private void FieldExcludeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!FieldExcludeBox.Items.Contains(FieldsExcludeTextInput.Text))
|
||||||
{
|
{
|
||||||
if (!MethodExcludeBox.Items.Contains(ExcludeMethodTextBox.Text))
|
FieldExcludeBox.Items.Add(FieldsExcludeTextInput.Text);
|
||||||
{
|
|
||||||
MethodExcludeBox.Items.Add(ExcludeMethodTextBox.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void MethodExcludeRemoveButton_Click(object sender, EventArgs e)
|
private void FieldExcludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (FieldExcludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (MethodExcludeBox.SelectedItem != null)
|
FieldExcludeBox.Items.Remove(FieldExcludeBox.SelectedItem);
|
||||||
{
|
|
||||||
MethodExcludeBox.Items.Remove(MethodExcludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void FIeldIncludeAddButton_Click(object sender, EventArgs e)
|
private void PropertiesIncludeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!PropertiesIncludeBox.Items.Contains(PropertiesIncludeTextField.Text))
|
||||||
{
|
{
|
||||||
if (!FieldIncludeBox.Items.Contains(FieldsIncludeTextInput.Text))
|
PropertiesIncludeBox.Items.Add(PropertiesIncludeTextField.Text);
|
||||||
{
|
|
||||||
FieldIncludeBox.Items.Add(FieldsIncludeTextInput.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void FieldIncludeRemoveButton_Click(object sender, EventArgs e)
|
private void PropertiesIncludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (PropertiesIncludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (FieldIncludeBox.SelectedItem != null)
|
PropertiesIncludeBox.Items.Remove(PropertiesIncludeBox.SelectedItem);
|
||||||
{
|
|
||||||
FieldIncludeBox.Items.Remove(FieldIncludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void FieldExcludeAddButton_Click(object sender, EventArgs e)
|
private void PropertiesExcludeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!PropertiesExcludeBox.Items.Contains(PropertiesExcludeTextField.Text))
|
||||||
{
|
{
|
||||||
if (!FieldExcludeBox.Items.Contains(FieldsExcludeTextInput.Text))
|
PropertiesExcludeBox.Items.Add(PropertiesExcludeTextField.Text);
|
||||||
{
|
|
||||||
FieldExcludeBox.Items.Add(FieldsExcludeTextInput.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void FieldExcludeRemoveButton_Click(object sender, EventArgs e)
|
private void PropertiesExcludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (PropertiesExcludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (FieldExcludeBox.SelectedItem != null)
|
PropertiesExcludeBox.Items.Remove(PropertiesExcludeBox.SelectedItem);
|
||||||
{
|
|
||||||
FieldExcludeBox.Items.Remove(FieldExcludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void PropertiesIncludeAddButton_Click(object sender, EventArgs e)
|
private void NestedTypesAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!NestedTypesIncludeBox.Items.Contains(NestedTypesIncludeTextField.Text))
|
||||||
{
|
{
|
||||||
if (!PropertiesIncludeBox.Items.Contains(PropertiesIncludeTextField.Text))
|
NestedTypesIncludeBox.Items.Add(NestedTypesIncludeTextField.Text);
|
||||||
{
|
|
||||||
PropertiesIncludeBox.Items.Add(PropertiesIncludeTextField.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void PropertiesIncludeRemoveButton_Click(object sender, EventArgs e)
|
private void NestedTypesRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (NestedTypesIncludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (PropertiesIncludeBox.SelectedItem != null)
|
NestedTypesIncludeBox.Items.Remove(NestedTypesIncludeBox.SelectedItem);
|
||||||
{
|
|
||||||
PropertiesIncludeBox.Items.Remove(PropertiesIncludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void PropertiesExcludeAddButton_Click(object sender, EventArgs e)
|
private void NestedTypesExlcudeAddButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!NestedTypesExcludeBox.Items.Contains(NestedTypesExcludeTextField.Text))
|
||||||
{
|
{
|
||||||
if (!PropertiesExcludeBox.Items.Contains(PropertiesExcludeTextField.Text))
|
NestedTypesExcludeBox.Items.Add(NestedTypesExcludeTextField.Text);
|
||||||
{
|
|
||||||
PropertiesExcludeBox.Items.Add(PropertiesExcludeTextField.Text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void PropertiesExcludeRemoveButton_Click(object sender, EventArgs e)
|
private void NestedTypesExcludeRemoveButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (NestedTypesExcludeBox.SelectedItem != null)
|
||||||
{
|
{
|
||||||
if (PropertiesExcludeBox.SelectedItem != null)
|
NestedTypesExcludeBox.Items.Remove(NestedTypesExcludeBox.SelectedItem);
|
||||||
{
|
|
||||||
PropertiesExcludeBox.Items.Remove(PropertiesExcludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void NestedTypesAddButton_Click(object sender, EventArgs e)
|
#endregion LISTBOX_BUTTONS
|
||||||
|
|
||||||
|
#endregion BUTTONS
|
||||||
|
|
||||||
|
// Reset All UI elements to default
|
||||||
|
private void ResetAll()
|
||||||
|
{
|
||||||
|
PopulateDomainUpDowns();
|
||||||
|
|
||||||
|
// Text fields
|
||||||
|
|
||||||
|
NewTypeName.Clear();
|
||||||
|
BaseClassIncludeTextFIeld.Clear();
|
||||||
|
BaseClassExcludeTextField.Clear();
|
||||||
|
NestedTypeParentName.Clear();
|
||||||
|
BaseClassExcludeTextField.Clear();
|
||||||
|
IncludeMethodTextBox.Clear();
|
||||||
|
ExcludeMethodTextBox.Clear();
|
||||||
|
FieldsIncludeTextInput.Clear();
|
||||||
|
FieldsExcludeTextInput.Clear();
|
||||||
|
PropertiesIncludeTextField.Clear();
|
||||||
|
PropertiesExcludeTextField.Clear();
|
||||||
|
NestedTypesIncludeTextField.Clear();
|
||||||
|
NestedTypesExcludeTextField.Clear();
|
||||||
|
|
||||||
|
// Numeric UpDowns
|
||||||
|
|
||||||
|
MethodCountUpDown.Value = 0;
|
||||||
|
FieldCountUpDown.Value = 0;
|
||||||
|
PropertyCountUpDown.Value = 0;
|
||||||
|
NestedTypeCountUpDown.Value = 0;
|
||||||
|
|
||||||
|
// Check boxes
|
||||||
|
|
||||||
|
ForceRenameCheckbox.Checked = false;
|
||||||
|
MethodCountEnabled.Checked = false;
|
||||||
|
FieldCountEnabled.Checked = false;
|
||||||
|
PropertyCountEnabled.Checked = false;
|
||||||
|
NestedTypeCountEnabled.Checked = false;
|
||||||
|
|
||||||
|
// List boxes
|
||||||
|
|
||||||
|
MethodIncludeBox.Items.Clear();
|
||||||
|
MethodExcludeBox.Items.Clear();
|
||||||
|
FieldIncludeBox.Items.Clear();
|
||||||
|
FieldExcludeBox.Items.Clear();
|
||||||
|
PropertiesIncludeBox.Items.Clear();
|
||||||
|
PropertiesExcludeBox.Items.Clear();
|
||||||
|
NestedTypesIncludeBox.Items.Clear();
|
||||||
|
NestedTypesExcludeBox.Items.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void PopulateDomainUpDowns()
|
||||||
|
{
|
||||||
|
// Clear them all first just incase
|
||||||
|
IsPublicUpDown.BuildStringList("IsPublic");
|
||||||
|
IsAbstractUpDown.BuildStringList("IsAbstract");
|
||||||
|
IsInterfaceUpDown.BuildStringList("IsInterface");
|
||||||
|
IsEnumUpDown.BuildStringList("IsEnum");
|
||||||
|
IsNestedUpDown.BuildStringList("IsNested");
|
||||||
|
IsSealedUpDown.BuildStringList("IsSealed");
|
||||||
|
HasAttributeUpDown.BuildStringList("HasAttribute");
|
||||||
|
IsDerivedUpDown.BuildStringList("IsDerived");
|
||||||
|
HasGenericParametersUpDown.BuildStringList("HasGenericParams");
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Subscribes the the remappers OnComplete event
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
private void ReloadTreeView(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
RemapTreeView.Nodes.Clear();
|
||||||
|
|
||||||
|
foreach (var remap in DataProvider.Remaps)
|
||||||
{
|
{
|
||||||
if (!NestedTypesIncludeBox.Items.Contains(NestedTypesIncludeTextField.Text))
|
RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this));
|
||||||
{
|
|
||||||
NestedTypesIncludeBox.Items.Add(NestedTypesIncludeTextField.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NestedTypesRemoveButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (NestedTypesIncludeBox.SelectedItem != null)
|
|
||||||
{
|
|
||||||
NestedTypesIncludeBox.Items.Remove(NestedTypesIncludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NestedTypesExlcudeAddButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (!NestedTypesExcludeBox.Items.Contains(NestedTypesExcludeTextField.Text))
|
|
||||||
{
|
|
||||||
NestedTypesExcludeBox.Items.Add(NestedTypesExcludeTextField.Text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void NestedTypesExcludeRemoveButton_Click(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
if (NestedTypesExcludeBox.SelectedItem != null)
|
|
||||||
{
|
|
||||||
NestedTypesExcludeBox.Items.Remove(NestedTypesExcludeBox.SelectedItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endregion LISTBOX_BUTTONS
|
|
||||||
|
|
||||||
#endregion BUTTONS
|
|
||||||
|
|
||||||
// Reset All UI elements to default
|
|
||||||
private void ResetAll()
|
|
||||||
{
|
|
||||||
PopulateDomainUpDowns();
|
|
||||||
|
|
||||||
// Text fields
|
|
||||||
|
|
||||||
NewTypeName.Clear();
|
|
||||||
BaseClassIncludeTextFIeld.Clear();
|
|
||||||
BaseClassExcludeTextField.Clear();
|
|
||||||
NestedTypeParentName.Clear();
|
|
||||||
BaseClassExcludeTextField.Clear();
|
|
||||||
IncludeMethodTextBox.Clear();
|
|
||||||
ExcludeMethodTextBox.Clear();
|
|
||||||
FieldsIncludeTextInput.Clear();
|
|
||||||
FieldsExcludeTextInput.Clear();
|
|
||||||
PropertiesIncludeTextField.Clear();
|
|
||||||
PropertiesExcludeTextField.Clear();
|
|
||||||
NestedTypesIncludeTextField.Clear();
|
|
||||||
NestedTypesExcludeTextField.Clear();
|
|
||||||
|
|
||||||
// Numeric UpDowns
|
|
||||||
|
|
||||||
MethodCountUpDown.Value = 0;
|
|
||||||
FieldCountUpDown.Value = 0;
|
|
||||||
PropertyCountUpDown.Value = 0;
|
|
||||||
NestedTypeCountUpDown.Value = 0;
|
|
||||||
|
|
||||||
// Check boxes
|
|
||||||
|
|
||||||
ForceRenameCheckbox.Checked = false;
|
|
||||||
MethodCountEnabled.Checked = false;
|
|
||||||
FieldCountEnabled.Checked = false;
|
|
||||||
PropertyCountEnabled.Checked = false;
|
|
||||||
NestedTypeCountEnabled.Checked = false;
|
|
||||||
|
|
||||||
// List boxes
|
|
||||||
|
|
||||||
MethodIncludeBox.Items.Clear();
|
|
||||||
MethodExcludeBox.Items.Clear();
|
|
||||||
FieldIncludeBox.Items.Clear();
|
|
||||||
FieldExcludeBox.Items.Clear();
|
|
||||||
PropertiesIncludeBox.Items.Clear();
|
|
||||||
PropertiesExcludeBox.Items.Clear();
|
|
||||||
NestedTypesIncludeBox.Items.Clear();
|
|
||||||
NestedTypesExcludeBox.Items.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void PopulateDomainUpDowns()
|
|
||||||
{
|
|
||||||
// Clear them all first just incase
|
|
||||||
IsPublicUpDown.BuildStringList("IsPublic");
|
|
||||||
IsAbstractUpDown.BuildStringList("IsAbstract");
|
|
||||||
IsInterfaceUpDown.BuildStringList("IsInterface");
|
|
||||||
IsEnumUpDown.BuildStringList("IsEnum");
|
|
||||||
IsNestedUpDown.BuildStringList("IsNested");
|
|
||||||
IsSealedUpDown.BuildStringList("IsSealed");
|
|
||||||
HasAttributeUpDown.BuildStringList("HasAttribute");
|
|
||||||
IsDerivedUpDown.BuildStringList("IsDerived");
|
|
||||||
HasGenericParametersUpDown.BuildStringList("HasGenericParams");
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Subscribes the the remappers OnComplete event
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="sender"></param>
|
|
||||||
/// <param name="e"></param>
|
|
||||||
private void ReloadTreeView(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
RemapTreeView.Nodes.Clear();
|
|
||||||
|
|
||||||
foreach (var remap in DataProvider.Remaps)
|
|
||||||
{
|
|
||||||
RemapTreeView.Nodes.Add(GUI.GenerateTreeNode(remap, this));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -123,4 +123,10 @@
|
|||||||
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>367, 17</value>
|
<value>367, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<metadata name="openFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>536, 17</value>
|
||||||
|
</metadata>
|
||||||
|
<metadata name="fileSystemWatcher1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
|
<value>767, 17</value>
|
||||||
|
</metadata>
|
||||||
</root>
|
</root>
|
@ -9,7 +9,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\AssemblyRemapper\LibRemap.csproj" />
|
<ProjectReference Include="..\AssemblyRemapper\MapLib.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
113
AssemblyRemapperGUI/SettingsController.cs
Normal file
113
AssemblyRemapperGUI/SettingsController.cs
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
using AssemblyRemapper.Utils;
|
||||||
|
|
||||||
|
namespace AssemblyRemapperGUI;
|
||||||
|
|
||||||
|
internal partial class AssemblyToolGUI
|
||||||
|
{
|
||||||
|
#region SETTINGS_BUTTONS
|
||||||
|
|
||||||
|
private void PickAssemblyPathButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
OpenFileDialog fDialog = new()
|
||||||
|
{
|
||||||
|
Title = "Select a DLL file",
|
||||||
|
Filter = "DLL Files (*.dll)|*.dll|All Files (*.*)|*.*",
|
||||||
|
Multiselect = false
|
||||||
|
};
|
||||||
|
|
||||||
|
if (fDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
DataProvider.Settings.AppSettings.AssemblyPath = fDialog.FileName;
|
||||||
|
DataProvider.LoadAssemblyDefinition();
|
||||||
|
AssemblyPathTextBox.Text = fDialog.FileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OutputDirectoryButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
using FolderBrowserDialog fDialog = new();
|
||||||
|
|
||||||
|
fDialog.Description = "Select a directory";
|
||||||
|
fDialog.ShowNewFolderButton = true;
|
||||||
|
|
||||||
|
if (fDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
DataProvider.Settings.AppSettings.OutputPath = fDialog.SelectedPath;
|
||||||
|
OutputPathTextBox.Text = fDialog.SelectedPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void MappingChooseButton_Click(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
var fDialog = new OpenFileDialog
|
||||||
|
{
|
||||||
|
Title = "Select a mapping file",
|
||||||
|
Filter = "JSON Files (*.json)|*.json|JSONC Files (*.jsonc)|*.jsonc|All Files (*.*)|*.*",
|
||||||
|
Multiselect = false
|
||||||
|
};
|
||||||
|
|
||||||
|
if (fDialog.ShowDialog() == DialogResult.OK)
|
||||||
|
{
|
||||||
|
DataProvider.LoadMappingFile(fDialog.FileName);
|
||||||
|
MappingPathTextBox.Text = fDialog.FileName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion SETTINGS_BUTTONS
|
||||||
|
|
||||||
|
#region CHECKBOXES
|
||||||
|
|
||||||
|
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.AppSettings.Publicize = PublicizeCheckbox.Checked;
|
||||||
|
DataProvider.SaveAppSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void UnsealCheckbox_CheckedChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DataProvider.Settings.AppSettings.Unseal = UnsealCheckbox.Checked;
|
||||||
|
DataProvider.SaveAppSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion CHECKBOXES
|
||||||
|
|
||||||
|
#region UPDOWNS
|
||||||
|
|
||||||
|
private void MaxMatchCountUpDown_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DataProvider.Settings.Remapper.MaxMatchCount = (int)MaxMatchCountUpDown.Value;
|
||||||
|
DataProvider.SaveAppSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void AutoMapperRequiredMatchesUpDown_ValueChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
DataProvider.Settings.AutoMapper.RequiredMatches = (int)AutoMapperRequiredMatchesUpDown.Value;
|
||||||
|
DataProvider.SaveAppSettings();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion UPDOWNS
|
||||||
|
}
|
@ -3,9 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00
|
|||||||
# Visual Studio Version 17
|
# Visual Studio Version 17
|
||||||
VisualStudioVersion = 17.9.34728.123
|
VisualStudioVersion = 17.9.34728.123
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibRemap", "AssemblyRemapper\LibRemap.csproj", "{84BF5F6E-9EEC-4B08-BE72-9F419A369124}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MapLib", "AssemblyRemapper\MapLib.csproj", "{84BF5F6E-9EEC-4B08-BE72-9F419A369124}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemapperGUI", "AssemblyRemapperGUI\RemapperGUI.csproj", "{A854A2C9-EB8B-4B70-BB79-17F689756F48}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RemapperGUI", "AssemblyRemapperGUI\RemapperGUI.csproj", "{A854A2C9-EB8B-4B70-BB79-17F689756F48}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RemapperConsole", "RemapperConsole\RemapperConsole.csproj", "{8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@ -21,6 +23,10 @@ Global
|
|||||||
{A854A2C9-EB8B-4B70-BB79-17F689756F48}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{A854A2C9-EB8B-4B70-BB79-17F689756F48}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{A854A2C9-EB8B-4B70-BB79-17F689756F48}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
{A854A2C9-EB8B-4B70-BB79-17F689756F48}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
{A854A2C9-EB8B-4B70-BB79-17F689756F48}.Release|Any CPU.Build.0 = Release|Any CPU
|
{A854A2C9-EB8B-4B70-BB79-17F689756F48}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{8D53FC01-49FD-47FB-9789-3DD6E53D6A7D}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
|
2
RemapperConsole/Program.cs
Normal file
2
RemapperConsole/Program.cs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// See https://aka.ms/new-console-template for more information
|
||||||
|
Console.WriteLine("Hello, World!");
|
14
RemapperConsole/RemapperConsole.csproj
Normal file
14
RemapperConsole/RemapperConsole.csproj
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\AssemblyRemapper\MapLib.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
@ -2,21 +2,19 @@
|
|||||||
"AppSettings": {
|
"AppSettings": {
|
||||||
"Debug": false, // Enables extra debug logging, slows down the program by alot
|
"Debug": false, // Enables extra debug logging, slows down the program by alot
|
||||||
"SilentMode": true, // The tool will stop and prompt you to continue on every remapping if disabled
|
"SilentMode": true, // The tool will stop and prompt you to continue on every remapping if disabled
|
||||||
"MatchMode": false // The assembly will not be written back to disk used only to score mappings
|
|
||||||
},
|
|
||||||
"Remapper": {
|
|
||||||
"MaxMatchCount": 5, // Max matches the remapper will return
|
|
||||||
"Publicize": true, // Publicize all types, methods, and properties : NOTE: Not run until after the remap has completed
|
|
||||||
"Unseal": true, // Unseal all types : NOTE: Not run until after the remap has completed
|
|
||||||
"AssemblyPath": "./Data/Managed/Assembly-CSharp.dll", // Path to the assembly we want to remap
|
"AssemblyPath": "./Data/Managed/Assembly-CSharp.dll", // Path to the assembly we want to remap
|
||||||
"OutputPath": "./Data/Assembly-CSharp-Remapped.dll", // Path including the filename and extension we want to write the changes to
|
"OutputPath": "./Data/Assembly-CSharp-Remapped.dll", // Path including the filename and extension we want to write the changes to
|
||||||
"MappingPath": "./Data/Mappings.jsonc" // Path to the mapping file
|
"MappingPath": "./Data/Mappings.jsonc", // Path to the mapping file
|
||||||
|
"RenameFields": true, // Names of fields of the matched type will be renamed to the type name with approproiate convention
|
||||||
|
"RenameProperties": true, // Names of properties of the matched type will be renamed to the type name with approproiate convention
|
||||||
|
"Publicize": true, // Publicize all types, methods, and properties : NOTE: Not run until after the remap has completed
|
||||||
|
"Unseal": true // Unseal all types : NOTE: Not run until after the remap has completed
|
||||||
|
},
|
||||||
|
"Remapper": {
|
||||||
|
"MaxMatchCount": 5 // Max matches the remapper will return
|
||||||
},
|
},
|
||||||
"AutoMapper": {
|
"AutoMapper": {
|
||||||
"RequiredMatches": 5, // Minimum number of times a member must have this name in the assembly before considering it for remapping
|
"RequiredMatches": 5, // Minimum number of times a member must have this name in the assembly before considering it for remapping
|
||||||
"MatchMode": true, // Disable making changes, only find matches and log
|
|
||||||
"Publicize": false, // Publicize all types, methods, and properties : NOTE: Not run until after the remap has completed
|
|
||||||
"Unseal": false, // Unseal all types : NOTE: Not run until after the remap has completed
|
|
||||||
"NamesToIgnore": [ // Any member name you want to ignore while iterating through the assembly
|
"NamesToIgnore": [ // Any member name you want to ignore while iterating through the assembly
|
||||||
|
|
||||||
]
|
]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user