コード例 #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
ファイル: AbstractModelBase.cs プロジェクト: docevaad/Anchor
 void Initialize()
 {
     m_PropertyChangedEventManager = new PropertyChangedEventManager(this);
     m_Errors = new ErrorsDictionary();
 }