public bool Validate(out string error) { error = null; bool isValid = true; var sb = new StringBuilder(); if (_legalDocuments.Items != null) { foreach (var document in _legalDocuments.Items) { var svr = new SchemaValidationResult(); isValid &= document.Validate(svr); if (svr.HasErrors()) { sb.Append(svr.ErrorMessage).Append(", "); } } if (sb.ToString().EndsWith(", ")) { sb.Length = sb.Length - 2; } error = sb.ToString(); } return(isValid); }
public bool Validate(out string error) { bool isValid = true; StringBuilder sb = new StringBuilder(); foreach (NamedValue factoryDefault in _factoryDefaults) { SchemaValidationResult svr = new SchemaValidationResult(); isValid &= factoryDefault.Validate(svr); if (svr.HasErrors()) { sb.Append(svr.ErrorMessage).Append(", "); } } if (sb.ToString().EndsWith(", ")) { sb.Length = sb.Length - 2; } error = sb.ToString(); return(isValid); }