2022-11-20 23:20:28 -07:00

45 lines
1.6 KiB
C#

using System.Text.Json;
using System.Text.Json.Serialization;
namespace View_by_Distance.Date.Group.Models;
public class Configuration
{
protected Property.Models.Configuration _PropertyConfiguration;
public Property.Models.Configuration PropertyConfiguration => _PropertyConfiguration;
public bool ByCreateDateShortcut { init; get; }
public bool ByDay { init; get; }
public bool ByHash { init; get; }
public bool ByNone { init; get; }
public bool BySeason { init; get; }
public bool ByWeek { init; get; }
public bool KeepFullPath { init; get; }
[JsonConstructor]
public Configuration(Property.Models.Configuration propertyConfiguration, bool byCreateDateShortcut, bool byDay, bool byHash, bool byNone, bool bySeason, bool byWeek, bool keepFullPath)
{
ByDay = byDay;
ByHash = byHash;
ByNone = byNone;
ByWeek = byWeek;
BySeason = bySeason;
KeepFullPath = keepFullPath;
ByCreateDateShortcut = byCreateDateShortcut;
_PropertyConfiguration = propertyConfiguration;
}
public override string ToString()
{
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
return result;
}
public void SetAndUpdate(Property.Models.Configuration configuration, int? numberOfJitters, int? numberOfTimesToUpsample, string? modelName, string? predictorModelName)
{
_PropertyConfiguration = configuration;
_PropertyConfiguration.Update(numberOfJitters, numberOfTimesToUpsample, modelName, predictorModelName);
}
}