System.Xml.Schema.XmlSchemaInference.MakeExistingAttributesOptional C# (CSharp) Méthode

MakeExistingAttributesOptional() private méthode

private MakeExistingAttributesOptional ( XmlSchemaComplexType ct, XmlSchemaObjectCollection attributesInInstance ) : void
ct XmlSchemaComplexType
attributesInInstance XmlSchemaObjectCollection
Résultat void
            internal void MakeExistingAttributesOptional(XmlSchemaComplexType ct, XmlSchemaObjectCollection attributesInInstance) {
                if (ct == null)  {
                    throw new XmlSchemaInferenceException(Res.SchInf_noct, 0, 0);
                }
                if (ct.ContentModel != null) {
                    XmlSchemaSimpleContentExtension xssce = CheckSimpleContentExtension(ct);
                    SwitchUseToOptional(xssce.Attributes, attributesInInstance);
                }
                else { //either <xs:attribute> as child of xs:complexType or the attributes are within the content model
                    SwitchUseToOptional(ct.Attributes, attributesInInstance);
                }
            }