Example #1
0
 public static void Validate(Bundle bundle)
 {
     if (bundle == null)
     {
         throw new ArgumentNullException("bundle");
     }
     Validator.ValidateObject(bundle, ValidationContextFactory.Create(bundle, null), true);
 }
Example #2
0
 public static void Validate(ResourceEntry entry)
 {
     if (entry == null)
     {
         throw new ArgumentNullException("entry");
     }
     Validator.ValidateObject(entry, ValidationContextFactory.Create(entry, null), true);
 }
Example #3
0
 public static void Validate(Element element)
 {
     if (element == null)
     {
         throw new ArgumentNullException("element");
     }
     Validator.ValidateObject(element, ValidationContextFactory.Create(element, null), true);
 }
Example #4
0
 public static void Validate(Resource resource)
 {
     if (resource == null)
     {
         throw new ArgumentNullException("resource");
     }
     Validator.ValidateObject(resource, ValidationContextFactory.Create(resource, null), true);
 }
Example #5
0
        public static void Validate(object value, bool recurse = false)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            //    assertSupportedInstanceType(value);

            Validator.ValidateObject(value, ValidationContextFactory.Create(value, null, recurse), true);
        }
Example #6
0
        public static bool TryValidate(Bundle bundle, ICollection <ValidationResult> validationResults = null)
        {
            if (bundle == null)
            {
                throw new ArgumentNullException("bundle");
            }

            var results = validationResults ?? new List <ValidationResult>();

            return(Validator.TryValidateObject(bundle, ValidationContextFactory.Create(bundle, null), results, true));
        }
Example #7
0
        public static bool TryValidate(ResourceEntry entry, ICollection <ValidationResult> validationResults = null)
        {
            if (entry == null)
            {
                throw new ArgumentNullException("entry");
            }

            var results = validationResults ?? new List <ValidationResult>();

            return(Validator.TryValidateObject(entry, ValidationContextFactory.Create(entry, null), results, true));
        }
Example #8
0
        public static bool TryValidate(object value, ICollection <ValidationResult> validationResults = null, bool recurse = false)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            // assertSupportedInstanceType(value);

            var results = validationResults ?? new List <ValidationResult>();

            return(Validator.TryValidateObject(value, ValidationContextFactory.Create(value, null, recurse), results, true));
        }