public NzbDroneValidationResult(IEnumerable <ValidationFailure> failures) { var errors = new List <NzbDroneValidationFailure>(); var warnings = new List <NzbDroneValidationFailure>(); foreach (var failureBase in failures) { var failure = failureBase as NzbDroneValidationFailure; if (failure == null) { failure = new NzbDroneValidationFailure(failureBase); } if (failure.IsWarning) { warnings.Add(failure); } else { errors.Add(failure); } } Failures = errors.Concat(warnings).ToList(); Errors = errors; errors.ForEach(base.Errors.Add); Warnings = warnings; }
public NzbDroneValidationResult(IEnumerable<ValidationFailure> failures) { var errors = new List<NzbDroneValidationFailure>(); var warnings = new List<NzbDroneValidationFailure>(); foreach (var failureBase in failures) { var failure = failureBase as NzbDroneValidationFailure; if (failure == null) { failure = new NzbDroneValidationFailure(failureBase); } if (failure.IsWarning) { warnings.Add(failure); } else { errors.Add(failure); } } Failures = errors.Concat(warnings).ToList(); Errors = errors; errors.ForEach(base.Errors.Add); Warnings = warnings; }