/// <summary> /// Initializes a new instance of the AllParticleValidator. /// </summary> /// <param name="particleConstraint"></param> internal AllParticleValidator(CompositeParticle particleConstraint) : base(particleConstraint) { Debug.Assert(particleConstraint != null); Debug.Assert(particleConstraint.ParticleType == ParticleType.All); // xsd:all can only contain xsd:element children and maxOccurs of each children can only be 1 #if DEBUG foreach (var constraint in particleConstraint.ChildrenParticles) { Debug.Assert(constraint.ParticleType == ParticleType.Element); // all children elements' maxOccurs must be 1 Debug.Assert(constraint.MaxOccurs == 1); } #endif this._childrenParticles = new Dictionary <int, bool>(this.ParticleConstraint.ChildrenParticles.Length); foreach (var childParticle in this.ParticleConstraint.ChildrenParticles) { this._childrenParticles.Add(childParticle.ElementId, false); } }
/// <summary> /// Initializes a new instance of the AllParticleValidator. /// </summary> /// <param name="particleConstraint"></param> internal AllParticleValidator(CompositeParticle particleConstraint) : base(particleConstraint) { Debug.Assert(particleConstraint != null); Debug.Assert(particleConstraint.ParticleType == ParticleType.All); // xsd:all can only contain xsd:element children and maxOccurs of each children can only be 1 #if DEBUG foreach (var constraint in particleConstraint.ChildrenParticles) { Debug.Assert(constraint.ParticleType == ParticleType.Element); // all children elements' maxOccurs must be 1 Debug.Assert(constraint.MaxOccurs == 1); } #endif this._childrenParticles = new Dictionary<int, bool>(this.ParticleConstraint.ChildrenParticles.Length); foreach (var childParticle in this.ParticleConstraint.ChildrenParticles) { this._childrenParticles.Add(childParticle.ElementId, false); } }
/// <summary> /// Initializes a new instance of the ChoiceParticleValidator. /// </summary> /// <param name="particleConstraint"></param> internal GroupParticleValidator(CompositeParticle particleConstraint) : base(particleConstraint) { Debug.Assert(particleConstraint != null); Debug.Assert(particleConstraint.ParticleType == ParticleType.Group); }
/// <summary> /// Initializes a new instance of the SequenceParticleValidator. /// </summary> /// <param name="particleConstraint"></param> internal SequenceParticleValidator(CompositeParticle particleConstraint) : base(particleConstraint) { Debug.Assert(particleConstraint != null); Debug.Assert(particleConstraint.ParticleType == ParticleType.Sequence); }