コード例 #1
0
        /// <summary>
        /// Caches the tree.
        /// </summary>
        /// <param name="validationControl">The validation control.</param>
        private static void CacheTree(ValidationControl validationControl)
        {
            switch (validationControl.ValidationMethod)
            {
            case TreeType.LogicalTree:
                CacheLogicalTree(validationControl, validationControl._fields);
                break;

            case TreeType.VisualTree:
                CacheVisualTree(validationControl, validationControl._fields);
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// Validates the tree.
        /// </summary>
        /// <param name="dependencyObject">The dependency object.</param>
        /// <param name="errors">The errors.</param>
        /// <param name="validationControl">The validation control.</param>
        private static void ValidateTree(DependencyObject dependencyObject, ReadOnlyErrorCollection errors,
                                         ValidationControl validationControl)
        {
            switch (validationControl.ValidationMethod)
            {
            case TreeType.LogicalTree:
                ValidateLogicalTree(dependencyObject, errors);
                break;

            case TreeType.VisualTree:
                ValidateVisualTree(dependencyObject, errors);
                break;
            }
        }
コード例 #3
0
        /// <summary>
        /// Validates the cache.
        /// </summary>
        /// <param name="validationControl">The validation control.</param>
        private static void ValidateCache(ValidationControl validationControl)
        {
            if (validationControl._fields == null)
            {
                validationControl._fields = new List <UIElement>();
                CacheTree(validationControl);
            }
            else if (validationControl._fields.Count == 0)
            {
                CacheTree(validationControl);
            }

            var errors = validationControl.Errors;

            foreach (var dependencyObject in validationControl._fields)
            {
                Validate(dependencyObject, errors);
            }
        }
コード例 #4
0
        /// <summary>
        /// Validates the tree.
        /// </summary>
        /// <param name="dependencyObject">The dependency object.</param>
        /// <param name="errors">The errors.</param>
        /// <param name="validationControl">The validation control.</param>
        private static void ValidateTree(DependencyObject dependencyObject, ReadOnlyErrorCollection errors,
		                                 ValidationControl validationControl)
        {
            switch (validationControl.ValidationMethod)
            {
                case TreeType.LogicalTree:
                    ValidateLogicalTree(dependencyObject, errors);
                    break;
                case TreeType.VisualTree:
                    ValidateVisualTree(dependencyObject, errors);
                    break;
            }
        }
コード例 #5
0
        /// <summary>
        /// Validates the cache.
        /// </summary>
        /// <param name="validationControl">The validation control.</param>
        private static void ValidateCache(ValidationControl validationControl)
        {
            if (validationControl._fields == null)
            {
                validationControl._fields = new List<UIElement>();
                CacheTree(validationControl);
            }
            else if (validationControl._fields.Count == 0)
            {
                CacheTree(validationControl);
            }

            var errors = validationControl.Errors;
            foreach (var dependencyObject in validationControl._fields)
            {
                Validate(dependencyObject, errors);
            }
        }
コード例 #6
0
 /// <summary>
 /// Caches the tree.
 /// </summary>
 /// <param name="validationControl">The validation control.</param>
 private static void CacheTree(ValidationControl validationControl)
 {
     switch (validationControl.ValidationMethod)
     {
         case TreeType.LogicalTree:
             CacheLogicalTree(validationControl, validationControl._fields);
             break;
         case TreeType.VisualTree:
             CacheVisualTree(validationControl, validationControl._fields);
             break;
     }
 }