Esempio n. 1
0
        private bool ValidateMatchesListElement(SchemaListElement ls, List <Match> input)
        {
            var l = input.Count;

            if (ls.Min > l)
            {
                ErrorMessage = "Less than minimal (" + ls.Min + ") amount of elements in a list.";
                return(false);
            }

            if (ls.Limited && ls.Max < l)
            {
                ErrorMessage = "More than maximum (" + ls.Max + ") amount of elements in a list.";
                return(false);
            }

            foreach (var sdf in input)
            {
                if (!ValidateMatches(ls.Element, sdf))
                {
                    return(false);
                }
            }

            return(true);
        }
Esempio n. 2
0
        private bool ValidateMatchesListElement(SchemaListElement ls, Match input, string attributeName = null)           // no lists or sequences
        {
            var l = new List <Match> {
                input
            };

            return(ValidateMatchesListElement(ls, l));
        }