33 lines
967 B
C#
33 lines
967 B
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace View_by_Distance.PrepareForOld.Models;
|
|
|
|
public class Configuration
|
|
{
|
|
|
|
protected Property.Models.Configuration _PropertyConfiguration;
|
|
protected readonly string[] _Spelling;
|
|
public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration;
|
|
public string[] Spelling => _Spelling;
|
|
|
|
[JsonConstructor]
|
|
public Configuration(Property.Models.Configuration propertyConfiguration, string[] spelling)
|
|
{
|
|
_PropertyConfiguration = propertyConfiguration;
|
|
_Spelling = spelling;
|
|
}
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
|
return result;
|
|
}
|
|
|
|
public void SetAndUpdate(Property.Models.Configuration configuration)
|
|
{
|
|
_PropertyConfiguration = configuration;
|
|
_PropertyConfiguration.Update();
|
|
}
|
|
|
|
} |