Init
This commit is contained in:
43
Compare/Models/Configuration.cs
Normal file
43
Compare/Models/Configuration.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Compare.Models;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
|
||||
protected readonly string _DiffPropertyDirectory;
|
||||
protected Property.Models.Configuration? _PropertyConfiguration;
|
||||
protected readonly string[] _Rename;
|
||||
protected readonly string[] _RenameB;
|
||||
protected readonly string[] _RenameC;
|
||||
protected readonly string[] _Spelling;
|
||||
public string DiffPropertyDirectory => _DiffPropertyDirectory;
|
||||
public Property.Models.Configuration? PropertyConfiguration => _PropertyConfiguration;
|
||||
public string[] Rename => _Rename;
|
||||
public string[] RenameB => _RenameB;
|
||||
public string[] RenameC => _RenameC;
|
||||
public string[] Spelling => _Spelling;
|
||||
|
||||
[JsonConstructor]
|
||||
public Configuration(string diffPropertyDirectory, Property.Models.Configuration? propertyConfiguration, string[] rename, string[] renameB, string[] renameC, string[] spelling)
|
||||
{
|
||||
_DiffPropertyDirectory = diffPropertyDirectory;
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
_Rename = rename;
|
||||
_RenameB = renameB;
|
||||
_RenameC = renameC;
|
||||
_Spelling = spelling;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
||||
return result;
|
||||
}
|
||||
|
||||
public void Set(Property.Models.Configuration propertyConfiguration) => _PropertyConfiguration = propertyConfiguration;
|
||||
|
||||
public void Update() => _PropertyConfiguration?.Update();
|
||||
|
||||
}
|
Reference in New Issue
Block a user