using Newtonsoft.Json; using System.ComponentModel; namespace ModpackUpdater; public class InstallInfos : IActionSetInfos { [JsonConverter(typeof(Newtonsoft.Json.Converters.VersionConverter))] public Version Version { get; set; } [DefaultValue(true)] public bool IsPublic { get; set; } = true; public List Actions { get; } = []; public List OptionSets { get; } = []; IEnumerable IActionSetInfos.Actions => Actions; public static InstallInfos Parse(string content) { return JsonConvert.DeserializeObject(content); } public override string ToString() { return JsonConvert.SerializeObject(this, new JsonSerializerSettings { Formatting = Formatting.Indented, DefaultValueHandling = DefaultValueHandling.IgnoreAndPopulate, }); } }