diff --git a/AudioCuesheetEditor/Model/IO/Export/ExportfileGenerator.cs b/AudioCuesheetEditor/Model/IO/Export/ExportfileGenerator.cs index ac448d0d..1665e78b 100644 --- a/AudioCuesheetEditor/Model/IO/Export/ExportfileGenerator.cs +++ b/AudioCuesheetEditor/Model/IO/Export/ExportfileGenerator.cs @@ -30,24 +30,16 @@ public enum ExportType Exportprofile } - public class ExportfileGenerator : Validateable + public class ExportfileGenerator(ExportType exportType, Cuesheet cuesheet, Exportprofile? exportprofile = null, ApplicationOptions? applicationOptions = null) : Validateable { - public Cuesheet Cuesheet { get; } - public Exportprofile? Exportprofile { get; set; } - public ApplicationOptions? ApplicationOptions { get; set; } - public ExportType ExportType { get; set; } - - public ExportfileGenerator(ExportType exportType, Cuesheet cuesheet, Exportprofile? exportprofile = null, ApplicationOptions? applicationOptions = null) - { - ExportType = exportType; - Cuesheet = cuesheet; - Exportprofile = exportprofile; - ApplicationOptions = applicationOptions; - } + public Cuesheet Cuesheet { get; } = cuesheet; + public Exportprofile? Exportprofile { get; set; } = exportprofile; + public ApplicationOptions? ApplicationOptions { get; set; } = applicationOptions; + public ExportType ExportType { get; set; } = exportType; public IReadOnlyCollection GenerateExportfiles() { - List exportfiles = new(); + List exportfiles = []; if (Validate().Status != ValidationStatus.Error) { if (Cuesheet.SplitPoints.Count != 0) diff --git a/AudioCuesheetEditor/Model/IO/Export/SplitPoint.cs b/AudioCuesheetEditor/Model/IO/Export/SplitPoint.cs index 78e782c7..492092f2 100644 --- a/AudioCuesheetEditor/Model/IO/Export/SplitPoint.cs +++ b/AudioCuesheetEditor/Model/IO/Export/SplitPoint.cs @@ -121,7 +121,7 @@ protected override ValidationResult Validate(string property) validationStatus = ValidationStatus.Success; if (Moment == null) { - validationMessages ??= new(); + validationMessages ??= []; validationMessages.Add(new ValidationMessage("{0} has no value!", nameof(Moment))); } else @@ -129,7 +129,7 @@ protected override ValidationResult Validate(string property) var maxEnd = Cuesheet?.Tracks.Max(x => x.End); if (Moment > maxEnd) { - validationMessages ??= new(); + validationMessages ??= []; validationMessages.Add(new ValidationMessage("{0} should be equal or less to '{1}'!", nameof(Moment), maxEnd)); } } @@ -138,7 +138,7 @@ protected override ValidationResult Validate(string property) validationStatus = ValidationStatus.Success; if (String.IsNullOrEmpty(Artist)) { - validationMessages ??= new(); + validationMessages ??= []; validationMessages.Add(new ValidationMessage("{0} has no value!", nameof(Artist))); } break; @@ -146,7 +146,7 @@ protected override ValidationResult Validate(string property) validationStatus = ValidationStatus.Success; if (String.IsNullOrEmpty(Title)) { - validationMessages ??= new(); + validationMessages ??= []; validationMessages.Add(new ValidationMessage("{0} has no value!", nameof(Title))); } break; @@ -154,7 +154,7 @@ protected override ValidationResult Validate(string property) validationStatus = ValidationStatus.Success; if (String.IsNullOrEmpty(AudiofileName)) { - validationMessages ??= new(); + validationMessages ??= []; validationMessages.Add(new ValidationMessage("{0} has no value!", nameof(AudiofileName))); } break;