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

MoveAttributes() private méthode

private MoveAttributes ( XmlSchemaComplexType ct, XmlSchemaSimpleContentExtension simpleContentExtension, bool bCreatingNewType ) : void
ct XmlSchemaComplexType
simpleContentExtension XmlSchemaSimpleContentExtension
bCreatingNewType bool
Résultat void
            private void MoveAttributes(XmlSchemaComplexType ct, XmlSchemaSimpleContentExtension simpleContentExtension, bool bCreatingNewType) {
                //copy all attributes from the complex type to the simple content
                
                ICollection sourceCollection;
                if (!bCreatingNewType && ct.AttributeUses.Count > 0) {
                    sourceCollection = ct.AttributeUses.Values;
                }
                else {
                    sourceCollection = ct.Attributes;
                }
                
                foreach (XmlSchemaAttribute attr in sourceCollection) {
                    simpleContentExtension.Attributes.Add(attr);
                }
                ct.Attributes.Clear(); //Clear from pre-compiled property, post compiled will be cleared on Re-process and Compile()
            }

Same methods

XmlSchemaInference::MoveAttributes ( XmlSchemaSimpleContentExtension scExtension, XmlSchemaComplexType ct ) : void