예제 #1
0
        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!");
                }
            }
        }
예제 #2
0
        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);
                    }
                }
            }
        }