|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
using System.Collections;
using System.Xml.Serialization;
namespace System.Xml.Schema
{
public class XmlSchemaSimpleTypeRestriction : XmlSchemaSimpleTypeContent
{
private XmlQualifiedName _baseTypeName = XmlQualifiedName.Empty;
private XmlSchemaSimpleType? _baseType;
private readonly XmlSchemaObjectCollection _facets = new XmlSchemaObjectCollection();
[XmlAttribute("base")]
public XmlQualifiedName BaseTypeName
{
get { return _baseTypeName; }
set { _baseTypeName = value ?? XmlQualifiedName.Empty; }
}
[XmlElement("simpleType", typeof(XmlSchemaSimpleType))]
public XmlSchemaSimpleType? BaseType
{
get { return _baseType; }
set { _baseType = value; }
}
[XmlElement("length", typeof(XmlSchemaLengthFacet)),
XmlElement("minLength", typeof(XmlSchemaMinLengthFacet)),
XmlElement("maxLength", typeof(XmlSchemaMaxLengthFacet)),
XmlElement("pattern", typeof(XmlSchemaPatternFacet)),
XmlElement("enumeration", typeof(XmlSchemaEnumerationFacet)),
XmlElement("maxInclusive", typeof(XmlSchemaMaxInclusiveFacet)),
XmlElement("maxExclusive", typeof(XmlSchemaMaxExclusiveFacet)),
XmlElement("minInclusive", typeof(XmlSchemaMinInclusiveFacet)),
XmlElement("minExclusive", typeof(XmlSchemaMinExclusiveFacet)),
XmlElement("totalDigits", typeof(XmlSchemaTotalDigitsFacet)),
XmlElement("fractionDigits", typeof(XmlSchemaFractionDigitsFacet)),
XmlElement("whiteSpace", typeof(XmlSchemaWhiteSpaceFacet))]
public XmlSchemaObjectCollection Facets
{
get { return _facets; }
}
internal override XmlSchemaObject Clone()
{
XmlSchemaSimpleTypeRestriction newRestriction = (XmlSchemaSimpleTypeRestriction)MemberwiseClone();
newRestriction.BaseTypeName = _baseTypeName.Clone();
return newRestriction;
}
}
}
|