System.Xml.Schema.SchemaCollectionPreprocessor.PreprocessAttributes C# (CSharp) Method

PreprocessAttributes() private method

private PreprocessAttributes ( XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent ) : void
attributes XmlSchemaObjectCollection
anyAttribute XmlSchemaAnyAttribute
parent XmlSchemaObject
return void
        private void PreprocessAttributes(XmlSchemaObjectCollection attributes, XmlSchemaAnyAttribute anyAttribute, XmlSchemaObject parent) {
            foreach (XmlSchemaAnnotated obj in attributes) {
                SetParent(obj, parent);
                if (obj is XmlSchemaAttribute) {
                    PreprocessLocalAttribute((XmlSchemaAttribute)obj);
                } 
                else { // XmlSchemaAttributeGroupRef
                    XmlSchemaAttributeGroupRef attributeGroupRef = (XmlSchemaAttributeGroupRef)obj;
                    if (attributeGroupRef.RefName.IsEmpty) {
                        SendValidationEvent(Res.Sch_MissAttribute, "ref", attributeGroupRef);
                    }
                    else {
                        ValidateQNameAttribute(attributeGroupRef, "ref", attributeGroupRef.RefName);
                    }
                    PreprocessAnnotation(obj); //set parent of annotation child of attributeGroupRef
                    ValidateIdAttribute(obj);
                }
            }
            if (anyAttribute != null) {
                try {
                    SetParent(anyAttribute, parent);
                    PreprocessAnnotation(anyAttribute); //set parent of annotation child of any attribute
                    anyAttribute.BuildNamespaceListV1Compat(this.targetNamespace);
                } 
                catch {
                    SendValidationEvent(Res.Sch_InvalidAnyAttribute, anyAttribute);
                }
                ValidateIdAttribute(anyAttribute);
            }
        }