43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
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();
|
|
|
|
} |