Catel.MVVM.ModelErrorInfo.HandleFieldWarnings C# (CSharp) Method

HandleFieldWarnings() private method

Handles the field warnings.
private HandleFieldWarnings ( string propertyName, IEnumerable warnings ) : void
propertyName string Name of the property.
warnings IEnumerable The warnings.
return void
        private void HandleFieldWarnings(string propertyName, IEnumerable warnings)
        {
            lock (_fieldWarnings)
            {
                if (_fieldWarnings.ContainsKey(propertyName))
                {
                    _fieldWarnings[propertyName].Clear();
                }
                else
                {
                    _fieldWarnings.Add(propertyName, new List<string>());
                }

                foreach (object warning in warnings)
                {
                    var warningAsString = GetValidationString(warning);
                    if (!string.IsNullOrEmpty(warningAsString))
                    {
                        _fieldWarnings[propertyName].Add(warningAsString);
                    }
                }
            }
        }