Пример #1
0
        void ValidateProperty(string propertyName)
        {
            var results = new ValidationResultCollection();

            AttributeBasedValidation(propertyName, results);

            OnValidateProperty(propertyName, results);

            OnErrorsChanged(propertyName, ErrorsDictionary.SetErrors(propertyName, results));
        }
Пример #2
0
        void ValidateObject()
        {
            var results = new ValidationResultCollection();

            OnValidateObject(results);
            OnErrorsChanged("", ErrorsDictionary.SetErrors(results, out var affectedProperties));

            foreach (var p in affectedProperties)
            {
                OnErrorsChanged(p);
            }
        }
Пример #3
0
 void Initialize()
 {
     m_PropertyChangedEventManager = new PropertyChangedEventManager(this);
     m_Errors = new ErrorsDictionary();
 }
Пример #4
0
        /// <summary>
        /// Returns a collection of property-level errors.
        /// </summary>
        /// <param name="propertyName">Null or String.Empty will return the object-level errors</param>
        /// <returns></returns>
        /// <remarks>
        /// Call Validate() to refresh this property.
        /// </remarks>

        public ReadOnlyCollection <ValidationResult> GetErrors(string propertyName)
        {
            return(ErrorsDictionary.GetErrors(propertyName));
        }
Пример #5
0
        /// <summary>
        /// Returns a collection of all errors (object and property level).
        /// </summary>
        /// <returns></returns>
        /// <remarks>
        /// Call Validate() to refresh this property.
        /// </remarks>

        public ReadOnlyCollection <ValidationResult> GetAllErrors()
        {
            return(ErrorsDictionary.GetAllErrors());
        }
Пример #6
0
 /// <summary>
 /// Clears the error collections and the HasErrors property
 /// </summary>
 public void ClearErrors()
 {
     OnErrorsChanged("", ErrorsDictionary.Clear());
 }
Пример #7
0
 void Initialize()
 {
     m_PropertyChangedEventManager = new PropertyChangedEventManager(this);
     m_Errors = new ErrorsDictionary();
 }