38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
|
|
namespace View_by_Distance.Set.Created.Date.Models;
|
|
|
|
public class Configuration
|
|
{
|
|
|
|
protected Property.Models.Configuration _PropertyConfiguration;
|
|
public string[] IgnoreExtensions { init; get; }
|
|
public string PersonBirthdayFormat { init; get; }
|
|
|
|
public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration;
|
|
|
|
[JsonConstructor]
|
|
public Configuration(
|
|
string[] ignoreExtensions,
|
|
string personBirthdayFormat,
|
|
Property.Models.Configuration propertyConfiguration)
|
|
{
|
|
IgnoreExtensions = ignoreExtensions;
|
|
PersonBirthdayFormat = personBirthdayFormat;
|
|
_PropertyConfiguration = propertyConfiguration;
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
} |