internal static ClrSimpleTypeInfo CreateSimpleTypeInfo(XmlSchemaType type)
        {
            ClrSimpleTypeInfo typeInfo = null;

            Debug.Assert(type.Datatype != null);
            switch (type.Datatype.Variety)
            {
            case XmlSchemaDatatypeVariety.Atomic:
            {
                typeInfo = new AtomicSimpleTypeInfo(type);
                break;
            }

            case XmlSchemaDatatypeVariety.List:
            {
                typeInfo = new ListSimpleTypeInfo(type);
                break;
            }

            case XmlSchemaDatatypeVariety.Union:
            {
                typeInfo = new UnionSimpleTypeInfo(type);
                break;
            }
            }
            return(typeInfo);
        }
示例#2
0
        internal static ClrSimpleTypeInfo CreateSimpleTypeInfo(XmlSchemaType type)
        {
            ClrSimpleTypeInfo typeInfo = null;

            Debug.Assert(type.Datatype != null);
            switch (type.Datatype.Variety)
            {
            case XmlSchemaDatatypeVariety.Atomic:
                if (type is XmlSchemaSimpleType simpleType && simpleType.IsEnum())
                {
                    typeInfo = new EnumSimpleTypeInfo(simpleType);
                }
                else
                {
                    typeInfo = new AtomicSimpleTypeInfo(type);
                }
                break;
示例#3
0
        internal static ClrSimpleTypeInfo CreateSimpleTypeInfo(XmlSchemaType type)
        {
             ClrSimpleTypeInfo typeInfo = null;

             Debug.Assert(type.Datatype != null);
             switch (type.Datatype.Variety)
             {
                 case XmlSchemaDatatypeVariety.Atomic: typeInfo = new AtomicSimpleTypeInfo(type);
                     break;
                 case XmlSchemaDatatypeVariety.List: typeInfo = new ListSimpleTypeInfo(type);
                     break;
                 case XmlSchemaDatatypeVariety.Union: typeInfo = new UnionSimpleTypeInfo(type);
                     break;
                 default:
                     break;
             }
             return typeInfo;
         }