/// <summary>
        /// Composite CT
        /// </summary>
        private static void ValidateCompositeComplexType(ValidationContext validationContext)
        {
            var particleConstraint = validationContext.GetParticleConstraint();

            if (particleConstraint is null)
            {
                return;
            }

            switch (particleConstraint.ParticleType)
            {
            case ParticleType.All:
            case ParticleType.Choice:
            case ParticleType.Sequence:
            case ParticleType.Group:
                ParticleValidator particleValidator = (ParticleValidator)particleConstraint.ParticleValidator;
                particleValidator.Validate(validationContext);
                break;

            case ParticleType.Invalid:
            case ParticleType.Element:
            case ParticleType.Any:
            default:
                Debug.Assert(false);
                break;
            }
        }
Ejemplo n.º 2
0
            internal static void Validate(ValidationContext validationContext, ParticleConstraint particleConstraint)
            {
                switch (particleConstraint.ParticleType)
                {
                case ParticleType.All:
                case ParticleType.Choice:
                case ParticleType.Sequence:
                case ParticleType.Group:
                    ParticleValidator particleValidator = (ParticleValidator)particleConstraint.ParticleValidator;
                    particleValidator.Validate(validationContext);
                    break;

                case ParticleType.Invalid:
                case ParticleType.Element:
                case ParticleType.Any:
                default:
                    Debug.Assert(false);
                    break;
                }
            }