Ejemplo n.º 1
0
        void ValidateProperty(string propertyName)
        {
            var results = new ValidationResultCollection();

            AttributeBasedValidation(propertyName, results);

            OnValidateProperty(propertyName, results);

            OnErrorsChanged(propertyName, ErrorsDictionary.SetErrors(propertyName, results));
        }
Ejemplo n.º 2
0
        void ValidateObject()
        {
            var results = new ValidationResultCollection();

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

            foreach (var p in affectedProperties)
            {
                OnErrorsChanged(p);
            }
        }
Ejemplo n.º 3
0
 void Initialize()
 {
     m_PropertyChangedEventManager = new PropertyChangedEventManager(this);
     m_Errors = new ErrorsDictionary();
 }
Ejemplo n.º 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));
        }
Ejemplo n.º 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());
        }
Ejemplo n.º 6
0
 /// <summary>
 /// Clears the error collections and the HasErrors property
 /// </summary>
 public void ClearErrors()
 {
     OnErrorsChanged("", ErrorsDictionary.Clear());
 }
Ejemplo n.º 7
0
 void Initialize()
 {
     m_PropertyChangedEventManager = new PropertyChangedEventManager(this);
     m_Errors = new ErrorsDictionary();
 }