public override void Validate(string propertyName = null) { base.Validate(propertyName); string currentProperty = nameof(CurrentPreferences); if (string.IsNullOrWhiteSpace(propertyName) || propertyName == currentProperty) { CurrentPreferences?.Validate(); if (CurrentPreferences.HasErrors) { AddError(currentProperty, "Invalid Preferences!"); } } }
public override void Validate(string propertyName = null) { base.Validate(propertyName); string currentProperty = nameof(CurrentPreferences); if (string.IsNullOrWhiteSpace(propertyName) || propertyName == currentProperty) { CurrentPreferences?.Validate(); if (CurrentPreferences.HasErrors) { AddError(currentProperty, "Invalid Preferences!"); if (CurrentPreferences.GetErrors(nameof(CurrentPreferences.DownloadSplitTime)) is List <string> downloadSplitTimeErrors && downloadSplitTimeErrors.Count > 0) { string firstError = downloadSplitTimeErrors.First(); AddError(nameof(DownloadSplitTimeHours), firstError); AddError(nameof(DownloadSplitTimeMinutes), firstError); AddError(nameof(DownloadSplitTimeSeconds), firstError); } } } }