Init
This commit is contained in:
43
Date-Group/Models/Configuration.cs
Normal file
43
Date-Group/Models/Configuration.cs
Normal file
@ -0,0 +1,43 @@
|
||||
using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace View_by_Distance.Date.Group.Models;
|
||||
|
||||
public class Configuration
|
||||
{
|
||||
|
||||
protected readonly bool? _ByDay;
|
||||
protected readonly bool? _ByHash;
|
||||
protected readonly bool? _BySeason;
|
||||
protected readonly bool? _ByWeek;
|
||||
protected readonly bool? _KeepFullPath;
|
||||
protected Property.Models.Configuration? _PropertyConfiguration;
|
||||
public bool? ByDay => _ByDay;
|
||||
public bool? ByHash => _ByHash;
|
||||
public bool? BySeason => _BySeason;
|
||||
public bool? ByWeek => _ByWeek;
|
||||
public bool? KeepFullPath => _KeepFullPath;
|
||||
public Property.Models.Configuration? PropertyConfiguration => _PropertyConfiguration;
|
||||
|
||||
[JsonConstructor]
|
||||
public Configuration(bool? byDay, bool? byHash, bool? bySeason, bool? byWeek, bool? keepFullPath, Property.Models.Configuration? propertyConfiguration)
|
||||
{
|
||||
_ByDay = byDay;
|
||||
_ByHash = byHash;
|
||||
_BySeason = bySeason;
|
||||
_ByWeek = byWeek;
|
||||
_KeepFullPath = keepFullPath;
|
||||
_PropertyConfiguration = propertyConfiguration;
|
||||
}
|
||||
|
||||
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