示例#1
0
        public XdtoValueType(XmlSchemaSimpleType xmlType, XdtoFactory factory)
        {
            NamespaceUri = xmlType.QualifiedName.Namespace;
            Name         = xmlType.QualifiedName.Name;

            if (xmlType.BaseXmlSchemaType is XmlSchemaSimpleType)
            {
                _baseType = new XdtoValueType(xmlType.BaseXmlSchemaType as XmlSchemaSimpleType, factory);
            }

            var memberTypes = new List <XdtoValueType> ();
            var facets      = new List <XdtoFacet> ();

            if (xmlType.Content is XmlSchemaSimpleTypeUnion)
            {
            }
            if (xmlType.Content is XmlSchemaSimpleTypeList)
            {
            }
            if (xmlType.Content is XmlSchemaSimpleTypeRestriction)
            {
                var restriction = xmlType.Content as XmlSchemaSimpleTypeRestriction;
                _baseType = new TypeResolver(factory, restriction.BaseTypeName);
            }

            MemberTypes  = new XdtoValueTypeCollection(memberTypes);
            Facets       = new XdtoFacetCollection(facets);
            ListItemType = new UndefinedOr <XdtoValueType> (null);

            Reader = this;
        }
示例#2
0
        internal XdtoValueType(XmlDataType primitiveType, IXdtoReader reader)
        {
            Name         = primitiveType.TypeName;
            NamespaceUri = primitiveType.NamespaceUri;

            var memberTypes = new List <XdtoValueType> ();
            var facets      = new List <XdtoFacet> ();

            MemberTypes  = new XdtoValueTypeCollection(memberTypes);
            Facets       = new XdtoFacetCollection(facets);
            ListItemType = new UndefinedOr <XdtoValueType> (null);

            Reader = reader;
        }