System.Xml.DocumentSchemaValidator.SetDefaultAttributeSchemaInfo C# (CSharp) Méthode

SetDefaultAttributeSchemaInfo() private méthode

private SetDefaultAttributeSchemaInfo ( XmlSchemaAttribute schemaAttribute ) : void
schemaAttribute System.Xml.Schema.XmlSchemaAttribute
Résultat void
        private void SetDefaultAttributeSchemaInfo(XmlSchemaAttribute schemaAttribute)
        {
            Debug.Assert(_attributeSchemaInfo != null);
            _attributeSchemaInfo.Clear();
            _attributeSchemaInfo.IsDefault = true;
            _attributeSchemaInfo.IsNil = false;
            _attributeSchemaInfo.SchemaType = schemaAttribute.AttributeSchemaType;
            _attributeSchemaInfo.SchemaAttribute = schemaAttribute;

            //Get memberType for default attribute
            SchemaAttDef attributeDef = schemaAttribute.AttDef;
            if (attributeDef.Datatype.Variety == XmlSchemaDatatypeVariety.Union)
            {
                XsdSimpleValue simpleValue = attributeDef.DefaultValueTyped as XsdSimpleValue;
                Debug.Assert(simpleValue != null);
                _attributeSchemaInfo.MemberType = simpleValue.XmlType;
            }
            _attributeSchemaInfo.Validity = XmlSchemaValidity.Valid;
        }