Catel.Data.ModelBase.INotifyDataErrorInfo C# (CSharp) Метод

INotifyDataErrorInfo() приватный Метод

Gets the validation errors for a specified property or for the entire object.
private INotifyDataErrorInfo ( string propertyName ) : IEnumerable
propertyName string The name of the property to retrieve validation errors for, or null or to retrieve errors for the entire object.
Результат IEnumerable
        IEnumerable INotifyDataErrorInfo.GetErrors(string propertyName)
        {
            var elements = new List<string>();

            if (HideValidationResults)
            {
                return elements;
            }

            if (string.IsNullOrEmpty(propertyName))
            {
                lock (_validationContext)
                {
                    foreach (var error in _validationContext.GetBusinessRuleErrors())
                    {
                        elements.Add(error.Message);
                    }

                }
            }
            else
            {
                lock (_validationContext)
                {
                    foreach (var error in _validationContext.GetFieldErrors(propertyName))
                    {
                        elements.Add(error.Message);
                    }
                }
            }

            return elements;
        }
        #endregion